<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Voodoo Shader Framework: K:/VoodooShader/DX8_Module/Wrapper.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>K:/VoodooShader/DX8_Module/Wrapper.cpp</h1><a href="_wrapper_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00002"></a>00002 <span class="preprocessor">#include &quot;<a class="code" href="_wrapper_8hpp.html">Wrapper.hpp</a>&quot;</span>
<a name="l00003"></a>00003 
<a name="l00004"></a><a class="code" href="_wrapper_8cpp.html#a8851208dfc71f393e4b07e822e8a9bf1">00004</a> <a class="code" href="class_voodoo_shader_1_1_core.html" title="Core engine class for the Voodoo Shader Framework.">VoodooShader::Core</a> * <a class="code" href="_wrapper_8cpp.html#a8851208dfc71f393e4b07e822e8a9bf1">VoodooCore</a> = NULL;
<a name="l00005"></a><a class="code" href="_wrapper_8cpp.html#a713cce27ba1e7e1d8ab9e8104f0d86af">00005</a> <a class="code" href="class_voodoo_shader_1_1_direct_x9_1_1_adapter.html">VoodooShader::DirectX9::Adapter</a> * <a class="code" href="_wrapper_8cpp.html#a713cce27ba1e7e1d8ab9e8104f0d86af">VoodooDX9</a> = NULL;
<a name="l00006"></a>00006 
<a name="l00007"></a><a class="code" href="_wrapper_8cpp.html#ab04e79b4d01b410a6f55518a117b2e65">00007</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="_wrapper_8cpp.html#ab04e79b4d01b410a6f55518a117b2e65">clientWND_width</a>, <a class="code" href="_wrapper_8cpp.html#af0af66b45ec5ffdc2594ffc6a3780a7f">clientWND_height</a>;
<a name="l00008"></a><a class="code" href="_wrapper_8cpp.html#a01d42336c19d3c17c527fc20b3f533fd">00008</a> <span class="keyword">static</span> HWND <a class="code" href="_wrapper_8cpp.html#a01d42336c19d3c17c527fc20b3f533fd">client_hWND</a>;
<a name="l00009"></a><a class="code" href="_wrapper_8cpp.html#a8bdb656d0b4203354c4f789f1c5f1c97">00009</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="_wrapper_8cpp.html#a8bdb656d0b4203354c4f789f1c5f1c97">WindowedMode</a>;
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="comment">//#define NV_PERF_HUD</span>
<a name="l00012"></a>00012 
<a name="l00013"></a><a class="code" href="_wrapper_8cpp.html#af25c35a701551195ac7076f143f57e3c">00013</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="_wrapper_8cpp.html#af25c35a701551195ac7076f143f57e3c">RenderingToTexture</a> = <span class="keyword">false</span>;
<a name="l00014"></a><a class="code" href="_wrapper_8cpp.html#a586e071d4deb99ff0849b33c1f6ca48e">00014</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="_wrapper_8cpp.html#a586e071d4deb99ff0849b33c1f6ca48e">RenderedLand</a> = <span class="keyword">false</span>;
<a name="l00015"></a><a class="code" href="_wrapper_8cpp.html#aa739ea8418e67af937fc262e863d54ed">00015</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="_wrapper_8cpp.html#aa739ea8418e67af937fc262e863d54ed">ShadowPlaneDrawn</a> = <span class="keyword">false</span>;
<a name="l00016"></a><a class="code" href="_wrapper_8cpp.html#a429224b9707f36b93e2d1c925b15cc48">00016</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="_wrapper_8cpp.html#a429224b9707f36b93e2d1c925b15cc48">RenderedGrass</a> = <span class="keyword">false</span>;
<a name="l00017"></a>00017 <span class="comment">//True when the main menu or game loading screens are showing</span>
<a name="l00018"></a><a class="code" href="_wrapper_8cpp.html#a32e2060c13011a2a8ca4092e3383731d">00018</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="_wrapper_8cpp.html#a32e2060c13011a2a8ca4092e3383731d">LoadingScreen</a> = <span class="keyword">true</span>;
<a name="l00019"></a>00019 
<a name="l00020"></a><a class="code" href="_wrapper_8cpp.html#aeabad8b7684a6990da651f8265fa4c52">00020</a> <span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code" href="_wrapper_8cpp.html#aeabad8b7684a6990da651f8265fa4c52">MatrixHUDidentifier</a>;
<a name="l00021"></a><a class="code" href="_wrapper_8cpp.html#ac80f60467004cecdbcc434e10825f4f6">00021</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="_wrapper_8cpp.html#ac80f60467004cecdbcc434e10825f4f6">HUDRenderingStarted</a> = <span class="keyword">false</span>;
<a name="l00022"></a><a class="code" href="_wrapper_8cpp.html#ab5a774dd58d680b977c059d7ab55c582">00022</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="_wrapper_8cpp.html#ab5a774dd58d680b977c059d7ab55c582">ShadersApplied</a> = <span class="keyword">false</span>;
<a name="l00023"></a><a class="code" href="_wrapper_8cpp.html#a6ae1f4ef0b7021f15268fb8f38867fcd">00023</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="_wrapper_8cpp.html#a6ae1f4ef0b7021f15268fb8f38867fcd">BackBufferWasCleared</a> = <span class="keyword">false</span>;
<a name="l00024"></a><a class="code" href="_wrapper_8cpp.html#ae7e3a6ad1f15cf83ba640689d354b2ea">00024</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="_wrapper_8cpp.html#ae7e3a6ad1f15cf83ba640689d354b2ea">zWriteEnabled</a> = 0;
<a name="l00025"></a><a class="code" href="_wrapper_8cpp.html#a1e4b60c8d10ca9a4146b7218925f7783">00025</a> <span class="keyword">static</span> DWORD <a class="code" href="_wrapper_8cpp.html#a1e4b60c8d10ca9a4146b7218925f7783">CurrentSrcBlend</a> = 0;
<a name="l00026"></a><a class="code" href="_wrapper_8cpp.html#a96a2fcb5be794bf5eec5ec5109257b0e">00026</a> <span class="keyword">static</span> DWORD <a class="code" href="_wrapper_8cpp.html#a96a2fcb5be794bf5eec5ec5109257b0e">CurrentDestBlend</a> = 0;
<a name="l00027"></a>00027 
<a name="l00028"></a><a class="code" href="_wrapper_8cpp.html#af31c27cd415c2e9856c7f2bc805d6a07">00028</a> <span class="keyword">static</span> IDirect3D8 *<a class="code" href="_wrapper_8cpp.html#af31c27cd415c2e9856c7f2bc805d6a07">fakeDirect3D</a>;
<a name="l00029"></a><a class="code" href="_wrapper_8cpp.html#a520e64000cf556d738e2bad2f0b411e5">00029</a> <span class="keyword">static</span> IDirect3DDevice8 *<a class="code" href="_wrapper_8cpp.html#a520e64000cf556d738e2bad2f0b411e5">fakeDevice</a>;
<a name="l00030"></a><a class="code" href="_wrapper_8cpp.html#ad871b1decd43033b5d94c5cd4240e77d">00030</a> <span class="keyword">static</span> <a class="code" href="struct___d3_d_c_a_p_s8.html">D3DCAPS8</a> <a class="code" href="_wrapper_8cpp.html#ad871b1decd43033b5d94c5cd4240e77d">d3d8Caps</a>;
<a name="l00031"></a>00031 
<a name="l00032"></a><a class="code" href="_wrapper_8cpp.html#a6297ac7e9cab3445bda0ffa00797f228">00032</a> IDirect3DTexture9 *<a class="code" href="_wrapper_8cpp.html#a6297ac7e9cab3445bda0ffa00797f228">FakeWaterTexture</a>;
<a name="l00033"></a>00033 
<a name="l00034"></a><a class="code" href="_wrapper_8cpp.html#a47a4861231fcf7d8b4643aaf225f18bc">00034</a> <span class="keyword">static</span> IDirect3DSurface9 *<a class="code" href="_wrapper_8cpp.html#a47a4861231fcf7d8b4643aaf225f18bc">OldDepthSurface</a>;
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="comment">//#include &lt;fstream&gt;</span>
<a name="l00037"></a>00037 <span class="comment">//using namespace std;</span>
<a name="l00038"></a>00038 <span class="comment">//ofstream wrapper_log_file (&quot;C:\\mge_wrapper_log.txt&quot;);</span>
<a name="l00039"></a>00039 
<a name="l00040"></a><a class="code" href="_wrapper_8cpp.html#a09467367454312afdf090ec7d63cb8b3">00040</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="_wrapper_8cpp.html#a09467367454312afdf090ec7d63cb8b3">tcount</a> = 0;
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="comment">//=============================================================================</span>
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 
<a name="l00045"></a><a class="code" href="class_fake_surface.html">00045</a> <span class="keyword">class </span><a class="code" href="class_fake_surface.html">FakeSurface</a> : <span class="keyword">public</span> IDirect3DSurface8 {
<a name="l00046"></a>00046 
<a name="l00047"></a>00047 <span class="keyword">public</span>:
<a name="l00048"></a><a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">00048</a>         IDirect3DSurface9 *<a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>;
<a name="l00049"></a>00049 
<a name="l00050"></a>00050 
<a name="l00051"></a>00051         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00052"></a>00052         <span class="comment">/*** Constructor ***/</span>
<a name="l00053"></a>00053         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00054"></a>00054 
<a name="l00055"></a><a class="code" href="class_fake_surface.html#a107b29a8d7d13ea1119f19b471b5a135">00055</a>         <a class="code" href="class_fake_surface.html#a107b29a8d7d13ea1119f19b471b5a135">FakeSurface</a> (IDirect3DSurface9 *Real) {
<a name="l00056"></a>00056                 <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a> = Real;
<a name="l00057"></a>00057                 <span class="keywordtype">void</span> *This = <span class="keyword">this</span>;
<a name="l00058"></a>00058                 Real-&gt;SetPrivateData (<a class="code" href="_wrapper_8hpp.html#aa9ea26faccd0670ffca16d885f3f2b94">guid</a>, (<span class="keywordtype">void</span> *)&amp;This, 4, 0);
<a name="l00059"></a>00059         }
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 
<a name="l00062"></a>00062         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00063"></a>00063         <span class="comment">/*** IUnknown methods ***/</span>
<a name="l00064"></a>00064         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00065"></a>00065 
<a name="l00066"></a><a class="code" href="class_fake_surface.html#a43fa6e65d15eeaded50dc5b6807d3e56">00066</a>         HRESULT _stdcall <a class="code" href="class_fake_surface.html#a43fa6e65d15eeaded50dc5b6807d3e56">QueryInterface</a> (REFIID riid, <span class="keywordtype">void</span> **ppvObj) {
<a name="l00067"></a>00067                 <span class="keywordflow">return</span> <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>-&gt;QueryInterface (riid, ppvObj);
<a name="l00068"></a>00068         }
<a name="l00069"></a>00069 
<a name="l00070"></a>00070         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00071"></a>00071 
<a name="l00072"></a><a class="code" href="class_fake_surface.html#aac6a2f615f349988af1ee0aa602c6851">00072</a>         ULONG _stdcall <a class="code" href="class_fake_surface.html#aac6a2f615f349988af1ee0aa602c6851">AddRef</a> () {
<a name="l00073"></a>00073                 <span class="keywordflow">return</span> <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>-&gt;AddRef ();
<a name="l00074"></a>00074         }
<a name="l00075"></a>00075 
<a name="l00076"></a>00076         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00077"></a>00077 
<a name="l00078"></a><a class="code" href="class_fake_surface.html#aa7ae90e9a095d25cd0cf768c2b57e3ac">00078</a>         ULONG _stdcall <a class="code" href="class_fake_surface.html#aa7ae90e9a095d25cd0cf768c2b57e3ac">Release</a> () {
<a name="l00079"></a>00079                 ULONG Refs = <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>-&gt;Release ();
<a name="l00080"></a>00080                 <span class="keywordflow">if</span> (!Refs) {
<a name="l00081"></a>00081                         <span class="keyword">delete</span> <span class="keyword">this</span>;
<a name="l00082"></a>00082                         <span class="keywordflow">return</span> 0;
<a name="l00083"></a>00083                 }
<a name="l00084"></a>00084                 <span class="keywordflow">return</span> Refs;
<a name="l00085"></a>00085         }
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 
<a name="l00088"></a>00088         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00089"></a>00089         <span class="comment">/*** IDirect3DSurface8 methods ***/</span>
<a name="l00090"></a>00090         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00091"></a>00091 
<a name="l00092"></a><a class="code" href="class_fake_surface.html#a4b60c964aafd9767bc9df7ed630bcff3">00092</a>         HRESULT _stdcall <a class="code" href="class_fake_surface.html#a4b60c964aafd9767bc9df7ed630bcff3">GetDevice</a> (IDirect3DDevice8 **ppDevice) {
<a name="l00093"></a>00093                 *ppDevice = <a class="code" href="_wrapper_8cpp.html#a520e64000cf556d738e2bad2f0b411e5">fakeDevice</a>;
<a name="l00094"></a>00094                 <a class="code" href="_wrapper_8cpp.html#a520e64000cf556d738e2bad2f0b411e5">fakeDevice</a>-&gt;AddRef ();
<a name="l00095"></a>00095                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00096"></a>00096         }
<a name="l00097"></a>00097 
<a name="l00098"></a>00098         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00099"></a>00099 
<a name="l00100"></a><a class="code" href="class_fake_surface.html#a65a0b815194a632a765632af596d3b12">00100</a>         HRESULT _stdcall <a class="code" href="class_fake_surface.html#a65a0b815194a632a765632af596d3b12">SetPrivateData</a> (REFGUID refguid, CONST <span class="keywordtype">void</span> *pData, DWORD SizeOfData, DWORD Flags) {
<a name="l00101"></a>00101                 <span class="keywordflow">return</span> <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>-&gt;SetPrivateData (refguid, pData, SizeOfData, Flags);
<a name="l00102"></a>00102         }
<a name="l00103"></a>00103 
<a name="l00104"></a>00104         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00105"></a>00105 
<a name="l00106"></a><a class="code" href="class_fake_surface.html#a6bb7892fcd3a6b68eadc47adebc2ea9f">00106</a>         HRESULT _stdcall <a class="code" href="class_fake_surface.html#a6bb7892fcd3a6b68eadc47adebc2ea9f">GetPrivateData</a> (REFGUID refguid, <span class="keywordtype">void</span> *pData, DWORD *pSizeOfData) {
<a name="l00107"></a>00107                 <span class="keywordflow">return</span> <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>-&gt;GetPrivateData (refguid, pData, pSizeOfData);
<a name="l00108"></a>00108         }
<a name="l00109"></a>00109 
<a name="l00110"></a>00110         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00111"></a>00111 
<a name="l00112"></a><a class="code" href="class_fake_surface.html#a7dcd557610e8bd54639a996b12496a92">00112</a>         HRESULT _stdcall <a class="code" href="class_fake_surface.html#a7dcd557610e8bd54639a996b12496a92">FreePrivateData</a> (REFGUID refguid) {
<a name="l00113"></a>00113                 <span class="keywordflow">return</span> <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>-&gt;FreePrivateData (refguid);
<a name="l00114"></a>00114         }
<a name="l00115"></a>00115 
<a name="l00116"></a>00116         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00117"></a>00117 
<a name="l00118"></a><a class="code" href="class_fake_surface.html#ae12bef2fb6f6cb927107dd007c76ee40">00118</a>         HRESULT _stdcall <a class="code" href="class_fake_surface.html#ae12bef2fb6f6cb927107dd007c76ee40">GetContainer</a> (REFIID riid, <span class="keywordtype">void</span> **ppContainer) {
<a name="l00119"></a>00119                 <span class="keywordflow">return</span> <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>-&gt;GetContainer (riid, ppContainer);
<a name="l00120"></a>00120         }
<a name="l00121"></a>00121 
<a name="l00122"></a>00122         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00123"></a>00123 
<a name="l00124"></a><a class="code" href="class_fake_surface.html#a230c3ed0e9d2ea960d61326707a3532e">00124</a>         HRESULT _stdcall <a class="code" href="class_fake_surface.html#a230c3ed0e9d2ea960d61326707a3532e">GetDesc</a> (<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html">D3DSURFACE_DESC8</a> *pDesc) {
<a name="l00125"></a>00125                 D3DSURFACE_DESC a2;
<a name="l00126"></a>00126                 HRESULT hr = <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>-&gt;GetDesc (&amp;a2);
<a name="l00127"></a>00127                 <span class="keywordflow">if</span> (hr == D3D_OK) {
<a name="l00128"></a>00128                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#af3122a78bd5fff053bb38c25e71b9187">Format</a> = a2.Format;
<a name="l00129"></a>00129                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#ae775728180cab928016b073c933db803">Height</a> = a2.Height;
<a name="l00130"></a>00130                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#a490dacf99f9ff7c7ffdce41d97753ab8">MultiSampleType</a> = a2.MultiSampleType;
<a name="l00131"></a>00131                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#a1f6e47b40065bc57c5e02b3a66b173c1">Pool</a> = a2.Pool;
<a name="l00132"></a>00132                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#a9103826f1912e7de36ea21af89e9bd70">Size</a> = 0; <span class="comment">//TODO: Fix;</span>
<a name="l00133"></a>00133                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#a88fa92873bb11fd548f4315435208d14">Type</a> = a2.Type;
<a name="l00134"></a>00134                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#a5f69077f229d72e3c14f967a441dec4e">Usage</a> = a2.Usage;
<a name="l00135"></a>00135                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#acabe9ed2b77c1a721c47768a47f5471b">Width</a> = a2.Width;
<a name="l00136"></a>00136                 }
<a name="l00137"></a>00137                 <span class="keywordflow">return</span> hr;
<a name="l00138"></a>00138         }
<a name="l00139"></a>00139 
<a name="l00140"></a>00140         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00141"></a>00141 
<a name="l00142"></a><a class="code" href="class_fake_surface.html#ae170294273b692030ee62970c14958cc">00142</a>         HRESULT _stdcall <a class="code" href="class_fake_surface.html#ae170294273b692030ee62970c14958cc">LockRect</a> (D3DLOCKED_RECT *pLockedRect, CONST RECT *pRect, DWORD Flags) {
<a name="l00143"></a>00143                 <span class="keywordflow">return</span> <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>-&gt;LockRect (pLockedRect, pRect, Flags);
<a name="l00144"></a>00144         }
<a name="l00145"></a>00145 
<a name="l00146"></a>00146         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00147"></a>00147 
<a name="l00148"></a><a class="code" href="class_fake_surface.html#a1190b17812f6a5181680642570b4fd88">00148</a>         HRESULT _stdcall <a class="code" href="class_fake_surface.html#a1190b17812f6a5181680642570b4fd88">UnlockRect</a> () {
<a name="l00149"></a>00149                 <span class="keywordflow">return</span> <a class="code" href="class_fake_surface.html#ab46b1546bd304071304ff135cf49af0c">mRealObject</a>-&gt;UnlockRect ();
<a name="l00150"></a>00150         }
<a name="l00151"></a>00151 
<a name="l00152"></a>00152         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00153"></a>00153 };
<a name="l00154"></a>00154 
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 <span class="comment">//=============================================================================</span>
<a name="l00157"></a><a class="code" href="_wrapper_8cpp.html#a589d64202487f78e3cc30dd2e04c5201">00157</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="_wrapper_8cpp.html#a589d64202487f78e3cc30dd2e04c5201">index</a> = 0;
<a name="l00158"></a>00158 
<a name="l00159"></a><a class="code" href="class_fake_texture.html">00159</a> <span class="keyword">class </span><a class="code" href="class_fake_texture.html">FakeTexture</a> : <span class="keyword">public</span> IDirect3DTexture8 {
<a name="l00160"></a>00160 
<a name="l00161"></a>00161 <span class="keyword">private</span>:
<a name="l00162"></a><a class="code" href="class_fake_texture.html#aec0e9c1ad21ae502fdd7dd174c2da64d">00162</a>         <span class="keywordtype">int</span> <a class="code" href="class_fake_texture.html#aec0e9c1ad21ae502fdd7dd174c2da64d">ltcount</a>;
<a name="l00163"></a>00163 
<a name="l00164"></a>00164 
<a name="l00165"></a>00165 <span class="keyword">public</span>:
<a name="l00166"></a><a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">00166</a>         IDirect3DTexture9 *<a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>;
<a name="l00167"></a><a class="code" href="class_fake_texture.html#a09f4699b05553987645ca4660abe5e9b">00167</a>         <a class="code" href="class_voodoo_shader_1_1_texture.html">VoodooShader::Texture</a> * <a class="code" href="class_fake_texture.html#a09f4699b05553987645ca4660abe5e9b">mTexture</a>;
<a name="l00168"></a>00168 
<a name="l00169"></a>00169 
<a name="l00170"></a>00170         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00171"></a>00171         <span class="comment">/*** Constructor ***/</span>
<a name="l00172"></a>00172         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00173"></a>00173 
<a name="l00174"></a><a class="code" href="class_fake_texture.html#a61b540560cea6751692ccd810e81ee8d">00174</a>         <a class="code" href="class_fake_texture.html#a61b540560cea6751692ccd810e81ee8d">FakeTexture</a> (IDirect3DTexture9 *Real) 
<a name="l00175"></a>00175         {
<a name="l00176"></a>00176                 <a class="code" href="class_fake_texture.html#aec0e9c1ad21ae502fdd7dd174c2da64d">ltcount</a> = <a class="code" href="_wrapper_8cpp.html#a09467367454312afdf090ec7d63cb8b3">tcount</a>++;
<a name="l00177"></a>00177                 <span class="keywordflow">if</span> (<a class="code" href="class_fake_texture.html#aec0e9c1ad21ae502fdd7dd174c2da64d">ltcount</a> == 76) {
<a name="l00178"></a>00178                         <span class="keywordtype">int</span> iii = 0;    <span class="comment">// What is this for? /krzymark/</span>
<a name="l00179"></a>00179                 }
<a name="l00180"></a>00180                 <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a> = Real;
<a name="l00181"></a>00181                 <span class="keywordtype">void</span> *This = <span class="keyword">this</span>;
<a name="l00182"></a>00182                 Real-&gt;SetPrivateData (<a class="code" href="_wrapper_8hpp.html#aa9ea26faccd0670ffca16d885f3f2b94">guid</a>, (<span class="keywordtype">void</span> *)&amp;This, 4, 0);
<a name="l00183"></a>00183                 <span class="comment">/*std::string textureName = &quot;texture&quot;;</span>
<a name="l00184"></a>00184 <span class="comment">                char indexString[8];</span>
<a name="l00185"></a>00185 <span class="comment">                _itoa(index++, indexString, 10);</span>
<a name="l00186"></a>00186 <span class="comment">                textureName += indexString;             </span>
<a name="l00187"></a>00187 <span class="comment"></span>
<a name="l00188"></a>00188 <span class="comment">                VoodooCore-&gt;CreateTexture(textureName, (void*)this);*/</span>
<a name="l00189"></a>00189         }
<a name="l00190"></a>00190 
<a name="l00191"></a>00191         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00192"></a>00192         <span class="comment">/*** IUnknown methods ***/</span>
<a name="l00193"></a>00193         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00194"></a>00194 
<a name="l00195"></a><a class="code" href="class_fake_texture.html#a9b6999416c105817b8b841bb3d7958cc">00195</a>         HRESULT _stdcall <a class="code" href="class_fake_texture.html#a9b6999416c105817b8b841bb3d7958cc">QueryInterface</a> (REFIID riid, <span class="keywordtype">void</span> **ppvObj) {
<a name="l00196"></a>00196                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;QueryInterface (riid, ppvObj);
<a name="l00197"></a>00197         }
<a name="l00198"></a>00198 
<a name="l00199"></a>00199         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00200"></a>00200 
<a name="l00201"></a><a class="code" href="class_fake_texture.html#a04233c5c037ed2e2ce4b4968d091bb22">00201</a>         ULONG _stdcall <a class="code" href="class_fake_texture.html#a04233c5c037ed2e2ce4b4968d091bb22">AddRef</a> () {
<a name="l00202"></a>00202                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;AddRef ();
<a name="l00203"></a>00203         }
<a name="l00204"></a>00204 
<a name="l00205"></a>00205         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00206"></a>00206 
<a name="l00207"></a><a class="code" href="class_fake_texture.html#a10f2359f1486095eb2c5e7d22d21f848">00207</a>         ULONG _stdcall <a class="code" href="class_fake_texture.html#a10f2359f1486095eb2c5e7d22d21f848">Release</a> () {
<a name="l00208"></a>00208                 <span class="comment">/*if (ltcount == 76) {</span>
<a name="l00209"></a>00209 <span class="comment">                        int iii = 0;    // What is this for? /krzymark/</span>
<a name="l00210"></a>00210 <span class="comment">                }*/</span>
<a name="l00211"></a>00211                 ULONG Refs = <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;Release ();
<a name="l00212"></a>00212                 <span class="keywordflow">if</span> (!Refs) {
<a name="l00213"></a>00213                         <span class="keyword">delete</span> <span class="keyword">this</span>;
<a name="l00214"></a>00214                         <span class="keywordflow">return</span> 0;
<a name="l00215"></a>00215                 }
<a name="l00216"></a>00216                 <span class="keywordflow">return</span> Refs;
<a name="l00217"></a>00217         }
<a name="l00218"></a>00218 
<a name="l00219"></a>00219 
<a name="l00220"></a>00220         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00221"></a>00221         <span class="comment">/*** IDirect3DBaseTexture8 methods ***/</span>
<a name="l00222"></a>00222         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00223"></a>00223 
<a name="l00224"></a><a class="code" href="class_fake_texture.html#a714b0f972b8eedbbf29ae0893f067a1d">00224</a>         HRESULT _stdcall <a class="code" href="class_fake_texture.html#a714b0f972b8eedbbf29ae0893f067a1d">GetDevice</a> (IDirect3DDevice8 **ppDevice) {
<a name="l00225"></a>00225                 *ppDevice = <a class="code" href="_wrapper_8cpp.html#a520e64000cf556d738e2bad2f0b411e5">fakeDevice</a>;
<a name="l00226"></a>00226                 <a class="code" href="_wrapper_8cpp.html#a520e64000cf556d738e2bad2f0b411e5">fakeDevice</a>-&gt;AddRef ();
<a name="l00227"></a>00227                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00228"></a>00228         }
<a name="l00229"></a>00229 
<a name="l00230"></a>00230         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00231"></a>00231 
<a name="l00232"></a><a class="code" href="class_fake_texture.html#ad18418352de69576c63fa3d5845de62d">00232</a>         HRESULT _stdcall <a class="code" href="class_fake_texture.html#ad18418352de69576c63fa3d5845de62d">SetPrivateData</a> (REFGUID refguid, CONST <span class="keywordtype">void</span> *pData, DWORD SizeOfData, DWORD Flags) {
<a name="l00233"></a>00233                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;SetPrivateData (refguid, pData, SizeOfData, Flags);
<a name="l00234"></a>00234         }
<a name="l00235"></a>00235 
<a name="l00236"></a>00236         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00237"></a>00237 
<a name="l00238"></a><a class="code" href="class_fake_texture.html#aa31c72604779b78aa642e80e4d7f6320">00238</a>         HRESULT _stdcall <a class="code" href="class_fake_texture.html#aa31c72604779b78aa642e80e4d7f6320">GetPrivateData</a> (REFGUID refguid, <span class="keywordtype">void</span> *pData, DWORD *pSizeOfData) {
<a name="l00239"></a>00239                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;GetPrivateData (refguid, pData, pSizeOfData);
<a name="l00240"></a>00240         }
<a name="l00241"></a>00241 
<a name="l00242"></a>00242         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00243"></a>00243 
<a name="l00244"></a><a class="code" href="class_fake_texture.html#ac707e85efb304ab87e27dd7a95e0804c">00244</a>         HRESULT _stdcall <a class="code" href="class_fake_texture.html#ac707e85efb304ab87e27dd7a95e0804c">FreePrivateData</a> (REFGUID refguid) {
<a name="l00245"></a>00245                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;FreePrivateData (refguid);
<a name="l00246"></a>00246         }
<a name="l00247"></a>00247 
<a name="l00248"></a>00248         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00249"></a>00249 
<a name="l00250"></a><a class="code" href="class_fake_texture.html#a1a8401bc12421f2cf288958550b9aa2d">00250</a>         DWORD _stdcall <a class="code" href="class_fake_texture.html#a1a8401bc12421f2cf288958550b9aa2d">SetPriority</a> (DWORD PriorityNew) {
<a name="l00251"></a>00251                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;SetPriority (PriorityNew);
<a name="l00252"></a>00252         }
<a name="l00253"></a>00253 
<a name="l00254"></a>00254         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00255"></a>00255 
<a name="l00256"></a><a class="code" href="class_fake_texture.html#a0ed1727bafc16b7c616f3af02ec348ff">00256</a>         DWORD _stdcall <a class="code" href="class_fake_texture.html#a0ed1727bafc16b7c616f3af02ec348ff">GetPriority</a> () {
<a name="l00257"></a>00257                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;GetPriority ();
<a name="l00258"></a>00258         }
<a name="l00259"></a>00259 
<a name="l00260"></a>00260         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00261"></a>00261 
<a name="l00262"></a><a class="code" href="class_fake_texture.html#a185c98b3bbd05f6eb09210bcc3972a8c">00262</a>         <span class="keywordtype">void</span> _stdcall <a class="code" href="class_fake_texture.html#a185c98b3bbd05f6eb09210bcc3972a8c">PreLoad</a> () {
<a name="l00263"></a>00263                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;PreLoad ();
<a name="l00264"></a>00264         }
<a name="l00265"></a>00265 
<a name="l00266"></a>00266         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00267"></a>00267 
<a name="l00268"></a><a class="code" href="class_fake_texture.html#a3445bb397518e4d39561e4830d05f061">00268</a>         D3DRESOURCETYPE _stdcall <a class="code" href="class_fake_texture.html#a3445bb397518e4d39561e4830d05f061">GetType</a> () {
<a name="l00269"></a>00269                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;GetType ();
<a name="l00270"></a>00270         }
<a name="l00271"></a>00271 
<a name="l00272"></a>00272         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00273"></a>00273 
<a name="l00274"></a><a class="code" href="class_fake_texture.html#a69ec69fc9cddbcd0e61cb674ff3feb62">00274</a>         DWORD _stdcall <a class="code" href="class_fake_texture.html#a69ec69fc9cddbcd0e61cb674ff3feb62">SetLOD</a> (DWORD LODNew) {
<a name="l00275"></a>00275                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;SetLOD (LODNew);
<a name="l00276"></a>00276         }
<a name="l00277"></a>00277 
<a name="l00278"></a>00278         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00279"></a>00279 
<a name="l00280"></a><a class="code" href="class_fake_texture.html#a97bcb4397f6d7301889568777ce7d8e8">00280</a>         DWORD _stdcall <a class="code" href="class_fake_texture.html#a97bcb4397f6d7301889568777ce7d8e8">GetLOD</a> () {
<a name="l00281"></a>00281                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;GetLOD ();
<a name="l00282"></a>00282         }
<a name="l00283"></a>00283 
<a name="l00284"></a>00284         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00285"></a>00285 
<a name="l00286"></a><a class="code" href="class_fake_texture.html#aaec3b66e0a180070b379ebe586b25a1c">00286</a>         DWORD _stdcall <a class="code" href="class_fake_texture.html#aaec3b66e0a180070b379ebe586b25a1c">GetLevelCount</a> () {
<a name="l00287"></a>00287                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;GetLevelCount ();
<a name="l00288"></a>00288         }
<a name="l00289"></a>00289 
<a name="l00290"></a>00290         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00291"></a>00291 
<a name="l00292"></a><a class="code" href="class_fake_texture.html#a7b4649b1b0883c8e5c0b1ca2231a4707">00292</a>         HRESULT _stdcall <a class="code" href="class_fake_texture.html#a7b4649b1b0883c8e5c0b1ca2231a4707">GetLevelDesc</a> (UINT Level, <a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html">D3DSURFACE_DESC8</a> *pDesc) {
<a name="l00293"></a>00293                 D3DSURFACE_DESC b2;
<a name="l00294"></a>00294                 HRESULT hr = <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;GetLevelDesc (Level, &amp;b2);
<a name="l00295"></a>00295                 <span class="keywordflow">if</span> (hr == D3D_OK) {
<a name="l00296"></a>00296                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#af3122a78bd5fff053bb38c25e71b9187">Format</a> = b2.Format;
<a name="l00297"></a>00297                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#ae775728180cab928016b073c933db803">Height</a> = b2.Height;
<a name="l00298"></a>00298                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#a490dacf99f9ff7c7ffdce41d97753ab8">MultiSampleType</a> = b2.MultiSampleType;
<a name="l00299"></a>00299                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#a1f6e47b40065bc57c5e02b3a66b173c1">Pool</a> = b2.Pool;
<a name="l00300"></a>00300                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#a9103826f1912e7de36ea21af89e9bd70">Size</a> = 0; <span class="comment">//TODO: Fix;</span>
<a name="l00301"></a>00301                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#a88fa92873bb11fd548f4315435208d14">Type</a> = b2.Type;
<a name="l00302"></a>00302                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#a5f69077f229d72e3c14f967a441dec4e">Usage</a> = b2.Usage;
<a name="l00303"></a>00303                         pDesc-&gt;<a class="code" href="struct___d3_d_s_u_r_f_a_c_e___d_e_s_c8.html#acabe9ed2b77c1a721c47768a47f5471b">Width</a> = b2.Width;
<a name="l00304"></a>00304                 }
<a name="l00305"></a>00305                 <span class="keywordflow">return</span> hr;
<a name="l00306"></a>00306         }
<a name="l00307"></a>00307 
<a name="l00308"></a>00308         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00309"></a>00309 
<a name="l00310"></a><a class="code" href="class_fake_texture.html#a86b01efd47f4360c0b0fa266723adadc">00310</a>         HRESULT _stdcall <a class="code" href="class_fake_texture.html#a86b01efd47f4360c0b0fa266723adadc">GetSurfaceLevel</a> (UINT Level, IDirect3DSurface8 **ppSurfaceLevel) {
<a name="l00311"></a>00311                 IDirect3DSurface9 *b2;
<a name="l00312"></a>00312                 *ppSurfaceLevel = NULL;
<a name="l00313"></a>00313                 DWORD unused = 4;
<a name="l00314"></a>00314                 HRESULT hr = <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;GetSurfaceLevel (Level, &amp;b2);
<a name="l00315"></a>00315                 <span class="keywordflow">if</span> (hr != D3D_OK || b2 == NULL) <span class="keywordflow">return</span> hr;
<a name="l00316"></a>00316                 hr = b2-&gt;GetPrivateData (<a class="code" href="_wrapper_8hpp.html#aa9ea26faccd0670ffca16d885f3f2b94">guid</a>, (<span class="keywordtype">void</span> *)ppSurfaceLevel, &amp;unused);
<a name="l00317"></a>00317                 <span class="keywordflow">if</span> (hr != D3D_OK) *ppSurfaceLevel = <span class="keyword">new</span> <a class="code" href="class_fake_surface.html">FakeSurface</a> (b2);
<a name="l00318"></a>00318                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00319"></a>00319         }
<a name="l00320"></a>00320 
<a name="l00321"></a>00321         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00322"></a>00322 
<a name="l00323"></a><a class="code" href="class_fake_texture.html#a2c5004a22d849aeeb82556091722e570">00323</a>         HRESULT _stdcall <a class="code" href="class_fake_texture.html#a2c5004a22d849aeeb82556091722e570">LockRect</a> (UINT Level, D3DLOCKED_RECT *pLockedRect, CONST RECT *pRect, DWORD Flags) {
<a name="l00324"></a>00324                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;LockRect (Level, pLockedRect, pRect, Flags);
<a name="l00325"></a>00325         }
<a name="l00326"></a>00326 
<a name="l00327"></a>00327         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00328"></a>00328 
<a name="l00329"></a><a class="code" href="class_fake_texture.html#a428e7c0958beae6040a7136f6d12924a">00329</a>         HRESULT _stdcall <a class="code" href="class_fake_texture.html#a428e7c0958beae6040a7136f6d12924a">UnlockRect</a> (UINT Level) {
<a name="l00330"></a>00330                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;UnlockRect (Level);
<a name="l00331"></a>00331         }
<a name="l00332"></a>00332 
<a name="l00333"></a>00333         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00334"></a>00334 
<a name="l00335"></a><a class="code" href="class_fake_texture.html#afcb77b1dc9bde4ddc678f7c72b7d2c7a">00335</a>         HRESULT _stdcall <a class="code" href="class_fake_texture.html#afcb77b1dc9bde4ddc678f7c72b7d2c7a">AddDirtyRect</a> (CONST RECT *pDirtyRect) {
<a name="l00336"></a>00336                 <span class="keywordflow">return</span> <a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>-&gt;AddDirtyRect (pDirtyRect);
<a name="l00337"></a>00337         }
<a name="l00338"></a>00338 
<a name="l00339"></a>00339         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00340"></a>00340 };
<a name="l00341"></a>00341 
<a name="l00342"></a>00342 
<a name="l00343"></a>00343 <span class="comment">//=============================================================================</span>
<a name="l00344"></a>00344 
<a name="l00345"></a>00345 
<a name="l00346"></a><a class="code" href="class_fake_device.html">00346</a> <span class="keyword">class </span><a class="code" href="class_fake_device.html">FakeDevice</a> : <span class="keyword">public</span> IDirect3DDevice8 {
<a name="l00347"></a>00347 
<a name="l00348"></a>00348 <span class="keyword">public</span>:
<a name="l00349"></a>00349 
<a name="l00350"></a>00350         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00351"></a>00351         <span class="comment">/*** Fields ***/</span>
<a name="l00352"></a>00352         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00353"></a>00353 
<a name="l00354"></a><a class="code" href="class_fake_device.html#adbddb0fdd54fb2d35e602d475e7d9918">00354</a>         IDirect3D8 *<a class="code" href="class_fake_device.html#adbddb0fdd54fb2d35e602d475e7d9918">Object</a>;
<a name="l00355"></a><a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">00355</a>         IDirect3DDevice9 * <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>;
<a name="l00356"></a><a class="code" href="class_fake_device.html#a6366ad72b711728dca8e9dd692c3a56c">00356</a>         DWORD <a class="code" href="class_fake_device.html#a6366ad72b711728dca8e9dd692c3a56c">Refs</a>;
<a name="l00357"></a><a class="code" href="class_fake_device.html#acf30afa80ffa62865b04427c91d6b206">00357</a>         UINT <a class="code" href="class_fake_device.html#acf30afa80ffa62865b04427c91d6b206">BaseVertexIndex</a>;
<a name="l00358"></a>00358 
<a name="l00359"></a><a class="code" href="class_fake_device.html#aa753a21e0bef0535a0d874644fae3a22">00359</a>         <span class="keywordtype">bool</span> <a class="code" href="class_fake_device.html#aa753a21e0bef0535a0d874644fae3a22">RecordRenders</a>;
<a name="l00360"></a><a class="code" href="class_fake_device.html#a43556729a1357ca7cdbdd465b30fbafa">00360</a>         D3DXMATRIX <a class="code" href="class_fake_device.html#a43556729a1357ca7cdbdd465b30fbafa">CurrentWorldTrans</a>;
<a name="l00361"></a><a class="code" href="class_fake_device.html#a9637f91df83c7dcaef4ae871d6f23cc5">00361</a>         <span class="keyword">const</span> <a class="code" href="_wrapper_8hpp.html#a0365b5833d9d4a8fc3e1d20571924177">D3DMATERIAL8</a> *<a class="code" href="class_fake_device.html#a9637f91df83c7dcaef4ae871d6f23cc5">CurrentMaterial</a>;
<a name="l00362"></a><a class="code" href="class_fake_device.html#a124b5a0aa5bc447bcfa96e6996dd8a91">00362</a>         IDirect3DTexture9 *<a class="code" href="class_fake_device.html#a124b5a0aa5bc447bcfa96e6996dd8a91">CurrentTexture</a>;
<a name="l00363"></a><a class="code" href="class_fake_device.html#ac75a85a982b778f35535aea66afa7cea">00363</a>         IDirect3DVertexBuffer9 *<a class="code" href="class_fake_device.html#ac75a85a982b778f35535aea66afa7cea">CurrentVBuffer</a>;
<a name="l00364"></a><a class="code" href="class_fake_device.html#aa68cca664ade44caa70996afd7fddb4f">00364</a>         IDirect3DIndexBuffer9 *<a class="code" href="class_fake_device.html#aa68cca664ade44caa70996afd7fddb4f">CurrentIndices</a>;
<a name="l00365"></a><a class="code" href="class_fake_device.html#acf4be540f2996010d9ae3e47be49cd34">00365</a>         DWORD <a class="code" href="class_fake_device.html#acf4be540f2996010d9ae3e47be49cd34">CurrentVertexBlendState</a>;
<a name="l00366"></a><a class="code" href="class_fake_device.html#a864ec71843d69b99c84eb22619de2c89">00366</a>         D3DXMATRIX <a class="code" href="class_fake_device.html#a864ec71843d69b99c84eb22619de2c89">CurrentBlendTrans1</a>;
<a name="l00367"></a><a class="code" href="class_fake_device.html#a121bba711e536a100797f4e6011997f7">00367</a>         D3DXMATRIX <a class="code" href="class_fake_device.html#a121bba711e536a100797f4e6011997f7">CurrentBlendTrans2</a>;
<a name="l00368"></a><a class="code" href="class_fake_device.html#a4102c8c7d53e797ab4c37ed8c5436ffb">00368</a>         D3DXMATRIX <a class="code" href="class_fake_device.html#a4102c8c7d53e797ab4c37ed8c5436ffb">CurrentBlendTrans3</a>;
<a name="l00369"></a><a class="code" href="class_fake_device.html#a6838e04623d2662a5eeb4b3dfdb715d9">00369</a>         DWORD <a class="code" href="class_fake_device.html#a6838e04623d2662a5eeb4b3dfdb715d9">CurrentCullModeState</a>;
<a name="l00370"></a>00370 
<a name="l00371"></a><a class="code" href="class_fake_device.html#aa6d5d66a0ad79cf4852cd266b8bf270e">00371</a>         DWORD <a class="code" href="class_fake_device.html#aa6d5d66a0ad79cf4852cd266b8bf270e">CurrentFVF</a>;
<a name="l00372"></a><a class="code" href="class_fake_device.html#ad78e3741b05b9b4338f87fbcdc05bef5">00372</a>         UINT <a class="code" href="class_fake_device.html#ad78e3741b05b9b4338f87fbcdc05bef5">CurrentStreamSpan</a>;
<a name="l00373"></a><a class="code" href="class_fake_device.html#a4c43b1397ff13d298e612f687333fa3d">00373</a>         DWORD <a class="code" href="class_fake_device.html#a4c43b1397ff13d298e612f687333fa3d">CurrentPShader</a>;
<a name="l00374"></a><a class="code" href="class_fake_device.html#a66ae179edd3a2b28cb0c871233785945">00374</a>         DWORD <a class="code" href="class_fake_device.html#a66ae179edd3a2b28cb0c871233785945">CurrentVShader</a>;
<a name="l00375"></a><a class="code" href="class_fake_device.html#aa168d4ab0d42e2cd7cdb28d63b25ecea">00375</a>         IDirect3DVertexShader9 *<a class="code" href="class_fake_device.html#aa168d4ab0d42e2cd7cdb28d63b25ecea">NewVShaders</a> [4];
<a name="l00376"></a><a class="code" href="class_fake_device.html#ad9dc5aa0c4d47cb8598df36069f8bcb3">00376</a>         IDirect3DPixelShader9 *<a class="code" href="class_fake_device.html#ad9dc5aa0c4d47cb8598df36069f8bcb3">NewPShaders</a> [9];
<a name="l00377"></a><a class="code" href="class_fake_device.html#a3541514b0d29347cd5c0fc3f9e8c5965">00377</a>         DWORD <a class="code" href="class_fake_device.html#a3541514b0d29347cd5c0fc3f9e8c5965">pShaderCount</a>;
<a name="l00378"></a><a class="code" href="class_fake_device.html#a04a679c4a8c8fac1e30e155d413cf2ba">00378</a>         DWORD <a class="code" href="class_fake_device.html#a04a679c4a8c8fac1e30e155d413cf2ba">vShaderCount</a>;
<a name="l00379"></a><a class="code" href="class_fake_device.html#a8d4deb416252736f35530a9b4807cb2d">00379</a>         IDirect3DVertexDeclaration9 *<a class="code" href="class_fake_device.html#a8d4deb416252736f35530a9b4807cb2d">decl</a> [2];
<a name="l00380"></a>00380 
<a name="l00381"></a><a class="code" href="struct_fake_device_1_1_render_state.html">00381</a>         <span class="keyword">struct </span><a class="code" href="struct_fake_device_1_1_render_state.html">RenderState</a> {
<a name="l00382"></a><a class="code" href="struct_fake_device_1_1_render_state.html#a65fc74530726f7c787e585f1265cb549">00382</a>                 DWORD <a class="code" href="struct_fake_device_1_1_render_state.html#a65fc74530726f7c787e585f1265cb549">FVF</a>;
<a name="l00383"></a><a class="code" href="struct_fake_device_1_1_render_state.html#a1e16f0d96b60023645380684101cb1aa">00383</a>                 DWORD <a class="code" href="struct_fake_device_1_1_render_state.html#a1e16f0d96b60023645380684101cb1aa">AlphaBlendEnable</a>;
<a name="l00384"></a><a class="code" href="struct_fake_device_1_1_render_state.html#a6d84841087b9851e4ac115ab3fcf4666">00384</a>                 DWORD <a class="code" href="struct_fake_device_1_1_render_state.html#a6d84841087b9851e4ac115ab3fcf4666">AlphaTestEnable</a>;
<a name="l00385"></a><a class="code" href="struct_fake_device_1_1_render_state.html#ad1b4f1734ddc3ff040669b8aad79ea25">00385</a>                 DWORD <a class="code" href="struct_fake_device_1_1_render_state.html#ad1b4f1734ddc3ff040669b8aad79ea25">SrcBlend</a>;
<a name="l00386"></a><a class="code" href="struct_fake_device_1_1_render_state.html#acc005e9341693cabff4bf25ce4d3d254">00386</a>                 DWORD <a class="code" href="struct_fake_device_1_1_render_state.html#acc005e9341693cabff4bf25ce4d3d254">DestBlend</a>;
<a name="l00387"></a><a class="code" href="struct_fake_device_1_1_render_state.html#af0c16a95d41f7d62fd0ebd25f0850ab9">00387</a>                 DWORD <a class="code" href="struct_fake_device_1_1_render_state.html#af0c16a95d41f7d62fd0ebd25f0850ab9">CullMode</a>;
<a name="l00388"></a><a class="code" href="struct_fake_device_1_1_render_state.html#a60141c2227b9444aaf9a4c79986308de">00388</a>                 DWORD <a class="code" href="struct_fake_device_1_1_render_state.html#a60141c2227b9444aaf9a4c79986308de">VertexBlend</a>;
<a name="l00389"></a><a class="code" href="struct_fake_device_1_1_render_state.html#a3930eb61c94318ca480ede8ffee52877">00389</a>                 DWORD <a class="code" href="struct_fake_device_1_1_render_state.html#a3930eb61c94318ca480ede8ffee52877">StencilEnable</a>;
<a name="l00390"></a><a class="code" href="struct_fake_device_1_1_render_state.html#a283ae26381b02c4b81bc65bc28811bf7">00390</a>                 DWORD <a class="code" href="struct_fake_device_1_1_render_state.html#a283ae26381b02c4b81bc65bc28811bf7">ZEnable</a>;
<a name="l00391"></a><a class="code" href="struct_fake_device_1_1_render_state.html#ab414583697330bc1e5ad673f807de84a">00391</a>                 DWORD <a class="code" href="struct_fake_device_1_1_render_state.html#ab414583697330bc1e5ad673f807de84a">ZWriteEnable</a>;
<a name="l00392"></a><a class="code" href="struct_fake_device_1_1_render_state.html#af9a2faf2f4cd03ae767ba216a35c2623">00392</a>                 D3DMATRIX <a class="code" href="struct_fake_device_1_1_render_state.html#af9a2faf2f4cd03ae767ba216a35c2623">View</a>;
<a name="l00393"></a><a class="code" href="struct_fake_device_1_1_render_state.html#a75488c993659db15cf562f81ff4ad04d">00393</a>                 D3DMATRIX <a class="code" href="struct_fake_device_1_1_render_state.html#a75488c993659db15cf562f81ff4ad04d">Projection</a>;
<a name="l00394"></a><a class="code" href="struct_fake_device_1_1_render_state.html#a7e73c0c30bef685ca250361ef15c43f2">00394</a>                 D3DMATRIX <a class="code" href="struct_fake_device_1_1_render_state.html#a7e73c0c30bef685ca250361ef15c43f2">World</a>;
<a name="l00395"></a>00395 
<a name="l00396"></a><a class="code" href="struct_fake_device_1_1_render_state.html#a4fd68d377d69d4f58d22d44fc7585cba">00396</a>                 <a class="code" href="struct_fake_device_1_1_render_state.html#a4fd68d377d69d4f58d22d44fc7585cba">RenderState</a>() {
<a name="l00397"></a>00397                         <span class="comment">//Set default values</span>
<a name="l00398"></a>00398                         <a class="code" href="struct_fake_device_1_1_render_state.html#a65fc74530726f7c787e585f1265cb549">FVF</a> = 0;
<a name="l00399"></a>00399                         <a class="code" href="struct_fake_device_1_1_render_state.html#a1e16f0d96b60023645380684101cb1aa">AlphaBlendEnable</a> = 0;
<a name="l00400"></a>00400                         <a class="code" href="struct_fake_device_1_1_render_state.html#a6d84841087b9851e4ac115ab3fcf4666">AlphaTestEnable</a> = 0;
<a name="l00401"></a>00401                         <a class="code" href="struct_fake_device_1_1_render_state.html#ad1b4f1734ddc3ff040669b8aad79ea25">SrcBlend</a> = 0;
<a name="l00402"></a>00402                         <a class="code" href="struct_fake_device_1_1_render_state.html#acc005e9341693cabff4bf25ce4d3d254">DestBlend</a> = 0;
<a name="l00403"></a>00403                         <a class="code" href="struct_fake_device_1_1_render_state.html#af0c16a95d41f7d62fd0ebd25f0850ab9">CullMode</a> = D3DCULL_CCW;
<a name="l00404"></a>00404                         <a class="code" href="struct_fake_device_1_1_render_state.html#a60141c2227b9444aaf9a4c79986308de">VertexBlend</a> = 0;
<a name="l00405"></a>00405                         <a class="code" href="struct_fake_device_1_1_render_state.html#a283ae26381b02c4b81bc65bc28811bf7">ZEnable</a> = 1;
<a name="l00406"></a>00406                         <a class="code" href="struct_fake_device_1_1_render_state.html#ab414583697330bc1e5ad673f807de84a">ZWriteEnable</a> = 1;
<a name="l00407"></a>00407                         
<a name="l00408"></a>00408                 }
<a name="l00409"></a>00409 
<a name="l00410"></a><a class="code" href="struct_fake_device_1_1_render_state.html#ad413a2dde37322132852cb3d8d61f88b">00410</a>                 <span class="keywordtype">void</span> <a class="code" href="struct_fake_device_1_1_render_state.html#ad413a2dde37322132852cb3d8d61f88b">SaveState</a>(IDirect3DDevice9 * device)
<a name="l00411"></a>00411                 {
<a name="l00412"></a>00412                         device-&gt;GetFVF(&amp;<a class="code" href="struct_fake_device_1_1_render_state.html#a65fc74530726f7c787e585f1265cb549">FVF</a>);
<a name="l00413"></a>00413                         device-&gt;GetRenderState( D3DRS_ALPHABLENDENABLE, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#a1e16f0d96b60023645380684101cb1aa">AlphaBlendEnable</a> );
<a name="l00414"></a>00414                         device-&gt;GetRenderState( D3DRS_ALPHATESTENABLE, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#a6d84841087b9851e4ac115ab3fcf4666">AlphaTestEnable</a> );
<a name="l00415"></a>00415                         device-&gt;GetRenderState( D3DRS_SRCBLEND, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#ad1b4f1734ddc3ff040669b8aad79ea25">SrcBlend</a> );
<a name="l00416"></a>00416                         device-&gt;GetRenderState( D3DRS_DESTBLEND, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#acc005e9341693cabff4bf25ce4d3d254">DestBlend</a> );
<a name="l00417"></a>00417                         device-&gt;GetRenderState( D3DRS_CULLMODE, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#af0c16a95d41f7d62fd0ebd25f0850ab9">CullMode</a> );
<a name="l00418"></a>00418                         device-&gt;GetRenderState( D3DRS_VERTEXBLEND, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#a60141c2227b9444aaf9a4c79986308de">VertexBlend</a> );
<a name="l00419"></a>00419                         device-&gt;GetRenderState( D3DRS_STENCILENABLE, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#a3930eb61c94318ca480ede8ffee52877">StencilEnable</a> );
<a name="l00420"></a>00420                         device-&gt;GetRenderState( D3DRS_ZENABLE, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#a283ae26381b02c4b81bc65bc28811bf7">ZEnable</a> );
<a name="l00421"></a>00421                         device-&gt;GetRenderState( D3DRS_ZWRITEENABLE, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#ab414583697330bc1e5ad673f807de84a">ZWriteEnable</a> );
<a name="l00422"></a>00422                         device-&gt;GetTransform( D3DTS_VIEW, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#af9a2faf2f4cd03ae767ba216a35c2623">View</a> );
<a name="l00423"></a>00423                         device-&gt;GetTransform( D3DTS_PROJECTION, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#a75488c993659db15cf562f81ff4ad04d">Projection</a> );
<a name="l00424"></a>00424                         device-&gt;GetTransform( D3DTS_WORLD, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#a7e73c0c30bef685ca250361ef15c43f2">World</a> );
<a name="l00425"></a>00425                 }
<a name="l00426"></a>00426 
<a name="l00427"></a><a class="code" href="struct_fake_device_1_1_render_state.html#a46eafe88e74ef55ae1e0791433c2d115">00427</a>                 <span class="keywordtype">void</span> <a class="code" href="struct_fake_device_1_1_render_state.html#a46eafe88e74ef55ae1e0791433c2d115">RestoreState</a>(IDirect3DDevice9 * device) {
<a name="l00428"></a>00428                         device-&gt;SetFVF(<a class="code" href="struct_fake_device_1_1_render_state.html#a65fc74530726f7c787e585f1265cb549">FVF</a>);
<a name="l00429"></a>00429                         device-&gt;SetRenderState( D3DRS_ALPHABLENDENABLE, <a class="code" href="struct_fake_device_1_1_render_state.html#a1e16f0d96b60023645380684101cb1aa">AlphaBlendEnable</a> );
<a name="l00430"></a>00430                         device-&gt;SetRenderState( D3DRS_ALPHATESTENABLE, <a class="code" href="struct_fake_device_1_1_render_state.html#a6d84841087b9851e4ac115ab3fcf4666">AlphaTestEnable</a> );
<a name="l00431"></a>00431                         device-&gt;SetRenderState( D3DRS_SRCBLEND, <a class="code" href="struct_fake_device_1_1_render_state.html#ad1b4f1734ddc3ff040669b8aad79ea25">SrcBlend</a> );
<a name="l00432"></a>00432                         device-&gt;SetRenderState( D3DRS_DESTBLEND, <a class="code" href="struct_fake_device_1_1_render_state.html#acc005e9341693cabff4bf25ce4d3d254">DestBlend</a> );
<a name="l00433"></a>00433                         device-&gt;SetRenderState( D3DRS_CULLMODE, <a class="code" href="struct_fake_device_1_1_render_state.html#af0c16a95d41f7d62fd0ebd25f0850ab9">CullMode</a> );
<a name="l00434"></a>00434                         device-&gt;SetRenderState( D3DRS_VERTEXBLEND, <a class="code" href="struct_fake_device_1_1_render_state.html#a60141c2227b9444aaf9a4c79986308de">VertexBlend</a> );
<a name="l00435"></a>00435                         device-&gt;SetRenderState( D3DRS_STENCILENABLE, <a class="code" href="struct_fake_device_1_1_render_state.html#a3930eb61c94318ca480ede8ffee52877">StencilEnable</a> );
<a name="l00436"></a>00436                         device-&gt;SetRenderState( D3DRS_ZENABLE, <a class="code" href="struct_fake_device_1_1_render_state.html#a283ae26381b02c4b81bc65bc28811bf7">ZEnable</a> );
<a name="l00437"></a>00437                         device-&gt;SetRenderState( D3DRS_ZWRITEENABLE, <a class="code" href="struct_fake_device_1_1_render_state.html#ab414583697330bc1e5ad673f807de84a">ZWriteEnable</a> );
<a name="l00438"></a>00438                         device-&gt;SetTransform( D3DTS_VIEW, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#af9a2faf2f4cd03ae767ba216a35c2623">View</a> );
<a name="l00439"></a>00439                         device-&gt;SetTransform( D3DTS_PROJECTION, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#a75488c993659db15cf562f81ff4ad04d">Projection</a> );
<a name="l00440"></a>00440                         device-&gt;SetTransform( D3DTS_WORLD, &amp;<a class="code" href="struct_fake_device_1_1_render_state.html#a7e73c0c30bef685ca250361ef15c43f2">World</a> );
<a name="l00441"></a>00441                 }
<a name="l00442"></a>00442         };
<a name="l00443"></a>00443 
<a name="l00444"></a><a class="code" href="class_fake_device.html#a543a74276836e37dc7b18302bf4eba69">00444</a>         <a class="code" href="struct_fake_device_1_1_render_state.html">RenderState</a> <a class="code" href="class_fake_device.html#a543a74276836e37dc7b18302bf4eba69">mRenderState</a>;
<a name="l00445"></a>00445 
<a name="l00446"></a>00446         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00447"></a>00447         <span class="comment">/*** Misc methods ***/</span>
<a name="l00448"></a>00448         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00449"></a>00449 
<a name="l00450"></a><a class="code" href="class_fake_device.html#a95b6e0db5154a3de400e3a0dd1327e44">00450</a>         <a class="code" href="class_fake_device.html#a95b6e0db5154a3de400e3a0dd1327e44">FakeDevice</a> (IDirect3D9 * <span class="keywordtype">object</span>, IDirect3DDevice9 * device) {
<a name="l00451"></a>00451                 this-&gt;<a class="code" href="class_fake_device.html#adbddb0fdd54fb2d35e602d475e7d9918">Object</a> = <span class="keyword">reinterpret_cast&lt;</span>IDirect3D8*<span class="keyword">&gt;</span>(object);
<a name="l00452"></a>00452                 this-&gt;<a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a> = device;
<a name="l00453"></a>00453                 <a class="code" href="class_fake_device.html#a6366ad72b711728dca8e9dd692c3a56c">Refs</a> = 1;
<a name="l00454"></a>00454                 <span class="comment">//TempBool = false;</span>
<a name="l00455"></a>00455                 <a class="code" href="class_fake_device.html#acf30afa80ffa62865b04427c91d6b206">BaseVertexIndex</a> = 0;
<a name="l00456"></a>00456                 <a class="code" href="class_fake_device.html#a4c43b1397ff13d298e612f687333fa3d">CurrentPShader</a> = 0;
<a name="l00457"></a>00457                 <a class="code" href="class_fake_device.html#a66ae179edd3a2b28cb0c871233785945">CurrentVShader</a> = 0;
<a name="l00458"></a>00458                 <a class="code" href="class_fake_device.html#a3541514b0d29347cd5c0fc3f9e8c5965">pShaderCount</a> = 0;
<a name="l00459"></a>00459                 <a class="code" href="class_fake_device.html#a04a679c4a8c8fac1e30e155d413cf2ba">vShaderCount</a> = 1;
<a name="l00460"></a>00460                 <a class="code" href="class_fake_device.html#aa753a21e0bef0535a0d874644fae3a22">RecordRenders</a> = <span class="keyword">false</span>;
<a name="l00461"></a>00461                 <span class="comment">//ZeroStruct(NewVShaders);</span>
<a name="l00462"></a>00462                 <span class="comment">//ZeroStruct(NewPShaders);</span>
<a name="l00463"></a>00463                 D3DVERTEXELEMENT9 elements [6] = {
<a name="l00464"></a>00464                         {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION},
<a name="l00465"></a>00465                         {0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD},
<a name="l00466"></a>00466                         D3DDECL_END (),
<a name="l00467"></a>00467                         {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION},
<a name="l00468"></a>00468                         {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR},
<a name="l00469"></a>00469                         D3DDECL_END ()
<a name="l00470"></a>00470                 };
<a name="l00471"></a>00471                 <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;CreateVertexDeclaration (elements, &amp;<a class="code" href="class_fake_device.html#a8d4deb416252736f35530a9b4807cb2d">decl</a> [0]);
<a name="l00472"></a>00472                 <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;CreateVertexDeclaration (&amp;elements [3], &amp;<a class="code" href="class_fake_device.html#a8d4deb416252736f35530a9b4807cb2d">decl</a> [1]);
<a name="l00473"></a>00473         }
<a name="l00474"></a>00474 
<a name="l00475"></a>00475 
<a name="l00476"></a>00476         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00477"></a>00477         <span class="comment">/*** IUnknown methods ***/</span>
<a name="l00478"></a>00478         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00479"></a>00479 
<a name="l00480"></a><a class="code" href="class_fake_device.html#a5b842cd866650880f68180ff3d13097d">00480</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a5b842cd866650880f68180ff3d13097d">QueryInterface</a> (REFIID a, LPVOID *b) {
<a name="l00481"></a>00481                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;QueryInterface (a, b);
<a name="l00482"></a>00482         }
<a name="l00483"></a>00483 
<a name="l00484"></a>00484         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00485"></a>00485 
<a name="l00486"></a><a class="code" href="class_fake_device.html#a9a412597963df376c59a2c6282dc0cb9">00486</a>         ULONG _stdcall <a class="code" href="class_fake_device.html#a9a412597963df376c59a2c6282dc0cb9">AddRef</a> (<span class="keywordtype">void</span>) {
<a name="l00487"></a>00487                 <span class="keywordflow">return</span> ++<a class="code" href="class_fake_device.html#a6366ad72b711728dca8e9dd692c3a56c">Refs</a>;
<a name="l00488"></a>00488         }
<a name="l00489"></a>00489 
<a name="l00490"></a>00490         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00491"></a>00491 
<a name="l00492"></a><a class="code" href="class_fake_device.html#ac330e6892b60ec55569183a87eaa967a">00492</a>         ULONG _stdcall <a class="code" href="class_fake_device.html#ac330e6892b60ec55569183a87eaa967a">Release</a> (<span class="keywordtype">void</span>) {
<a name="l00493"></a>00493                 <span class="keywordflow">if</span> (--<a class="code" href="class_fake_device.html#a6366ad72b711728dca8e9dd692c3a56c">Refs</a> == 0) {
<a name="l00494"></a>00494                         <span class="comment">// Shut down</span>
<a name="l00495"></a>00495                         
<a name="l00496"></a>00496                         <span class="keywordflow">return</span> 0;
<a name="l00497"></a>00497                 }
<a name="l00498"></a>00498                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a6366ad72b711728dca8e9dd692c3a56c">Refs</a>;
<a name="l00499"></a>00499         }
<a name="l00500"></a>00500 
<a name="l00501"></a>00501 
<a name="l00502"></a>00502         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00503"></a>00503         <span class="comment">/*** IDirect3DDevice8 methods ***/</span>
<a name="l00504"></a>00504         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00505"></a>00505 
<a name="l00506"></a><a class="code" href="class_fake_device.html#aed336bf442402061522e3fbbac1cdd30">00506</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#aed336bf442402061522e3fbbac1cdd30">TestCooperativeLevel</a>(<span class="keywordtype">void</span>)
<a name="l00507"></a>00507         {
<a name="l00508"></a>00508                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;TestCooperativeLevel();
<a name="l00509"></a>00509         }
<a name="l00510"></a>00510 
<a name="l00511"></a>00511         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00512"></a>00512 
<a name="l00520"></a><a class="code" href="class_fake_device.html#a4040a47856348b6a556a712f66331d03">00520</a>         UINT _stdcall <a class="code" href="class_fake_device.html#a4040a47856348b6a556a712f66331d03" title="Retrieves the amount of free texture memory, as reported by the video card drivers...">GetAvailableTextureMem</a>(<span class="keywordtype">void</span>)
<a name="l00521"></a>00521         {
<a name="l00522"></a>00522                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetAvailableTextureMem ();
<a name="l00523"></a>00523         }
<a name="l00524"></a>00524 
<a name="l00528"></a><a class="code" href="class_fake_device.html#aa96a8d92478cd00d85c3e5cb08bfdab7">00528</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#aa96a8d92478cd00d85c3e5cb08bfdab7">ResourceManagerDiscardBytes</a>(DWORD a) 
<a name="l00529"></a>00529         {
<a name="l00530"></a>00530                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00531"></a>00531                 <span class="comment">//return RealDevice-&gt;EvictManagedResources();</span>
<a name="l00532"></a>00532         }
<a name="l00533"></a>00533 
<a name="l00534"></a>00534         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00535"></a>00535 
<a name="l00536"></a><a class="code" href="class_fake_device.html#a41591d9ed8559f15681842e92637aa35">00536</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a41591d9ed8559f15681842e92637aa35">GetDirect3D</a> (IDirect3D8 **a) {
<a name="l00537"></a>00537                 *a = <a class="code" href="class_fake_device.html#adbddb0fdd54fb2d35e602d475e7d9918">Object</a>;
<a name="l00538"></a>00538                 <a class="code" href="class_fake_device.html#adbddb0fdd54fb2d35e602d475e7d9918">Object</a>-&gt;AddRef ();
<a name="l00539"></a>00539                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00540"></a>00540         }
<a name="l00541"></a>00541 
<a name="l00542"></a>00542         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00543"></a>00543 
<a name="l00544"></a><a class="code" href="class_fake_device.html#af8c778a3a3136f9a9585e633759b3ffb">00544</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#af8c778a3a3136f9a9585e633759b3ffb">GetDeviceCaps</a> (<a class="code" href="struct___d3_d_c_a_p_s8.html">D3DCAPS8</a> *a) {
<a name="l00545"></a>00545                 *a = d3d8Caps;
<a name="l00546"></a>00546                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00547"></a>00547         }
<a name="l00548"></a>00548 
<a name="l00549"></a>00549         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00550"></a>00550 
<a name="l00551"></a><a class="code" href="class_fake_device.html#a11c1a3dbcea9fd50898c3b8954bf1a0a">00551</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a11c1a3dbcea9fd50898c3b8954bf1a0a">GetDisplayMode</a>(D3DDISPLAYMODE * mode)
<a name="l00552"></a>00552         {
<a name="l00553"></a>00553                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetDisplayMode(0, mode);
<a name="l00554"></a>00554         }
<a name="l00555"></a>00555 
<a name="l00556"></a>00556         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00557"></a>00557 
<a name="l00558"></a><a class="code" href="class_fake_device.html#ac0200474394b4f8b59f7f2f699aa8741">00558</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ac0200474394b4f8b59f7f2f699aa8741">GetCreationParameters</a>(D3DDEVICE_CREATION_PARAMETERS * params)
<a name="l00559"></a>00559         {
<a name="l00560"></a>00560                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetCreationParameters(params);
<a name="l00561"></a>00561         }
<a name="l00562"></a>00562 
<a name="l00563"></a>00563         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00564"></a>00564 
<a name="l00565"></a><a class="code" href="class_fake_device.html#a2af5b98b3118bc7c32da490ed55e6e43">00565</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a2af5b98b3118bc7c32da490ed55e6e43">SetCursorProperties</a>(UINT a, UINT b, IDirect3DSurface8 *c)
<a name="l00566"></a>00566         {
<a name="l00567"></a>00567                 <span class="comment">//return RealDevice-&gt;SetCursorProperties (a, b, ((FakeSurface *)c)-&gt;mRealObject);</span>
<a name="l00568"></a>00568                 <span class="keywordflow">return</span> 1;
<a name="l00569"></a>00569         }
<a name="l00570"></a>00570 
<a name="l00571"></a>00571         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00572"></a>00572 
<a name="l00573"></a><a class="code" href="class_fake_device.html#a0faca5aa0f1fb4b74649b936725d00eb">00573</a>         <span class="keywordtype">void</span> _stdcall <a class="code" href="class_fake_device.html#a0faca5aa0f1fb4b74649b936725d00eb">SetCursorPosition</a>(<span class="keywordtype">int</span> X, <span class="keywordtype">int</span> Y, DWORD c)
<a name="l00574"></a>00574         {
<a name="l00575"></a>00575                 <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetCursorPosition(X, Y, c);
<a name="l00576"></a>00576         }
<a name="l00577"></a>00577 
<a name="l00578"></a>00578         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00579"></a>00579 
<a name="l00580"></a><a class="code" href="class_fake_device.html#a3e4e85b16c7c9b38f384812ebff0dbf8">00580</a>         BOOL _stdcall <a class="code" href="class_fake_device.html#a3e4e85b16c7c9b38f384812ebff0dbf8">ShowCursor</a> (BOOL a)
<a name="l00581"></a>00581         {
<a name="l00582"></a>00582                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;ShowCursor(a);
<a name="l00583"></a>00583         }
<a name="l00584"></a>00584 
<a name="l00585"></a>00585         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00586"></a>00586 
<a name="l00587"></a><a class="code" href="class_fake_device.html#ab399f1427c9f1d85e61b61f081f8582e">00587</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ab399f1427c9f1d85e61b61f081f8582e">CreateAdditionalSwapChain</a>(<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html">D3DPRESENT_PARAMETERS8</a> * a, <a class="code" href="_wrapper_8hpp.html#a8703f4430477604ca60736eaa812b0cf">IDirect3DSwapChain8</a> ** b)
<a name="l00588"></a>00588         {
<a name="l00589"></a>00589                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a>();
<a name="l00590"></a>00590         }
<a name="l00591"></a>00591 
<a name="l00592"></a>00592         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00593"></a>00593 
<a name="l00594"></a><a class="code" href="class_fake_device.html#ae5baa1ff6c444cbf67d318f7ef19d8d7">00594</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ae5baa1ff6c444cbf67d318f7ef19d8d7">Reset</a>(<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html">D3DPRESENT_PARAMETERS8</a> * presentparams)
<a name="l00595"></a>00595         {
<a name="l00596"></a>00596                 <a class="code" href="_wrapper_8hpp.html#a0604f04fe31c715e66d2b6ed3eb10d99">D3DPRESENT_PARAMETERS9</a> pp;
<a name="l00597"></a>00597                 pp.Flags = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a8666139cb242168804f6f891f965d4be">Flags</a>;
<a name="l00598"></a>00598                 pp.Windowed = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a2bcc288fa1fd90760bed8c3dac31d408">Windowed</a>;
<a name="l00599"></a>00599                 pp.BackBufferCount = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a0d0660e554c1c791bb170406794ad9be">BackBufferCount</a>;
<a name="l00600"></a>00600                 pp.BackBufferFormat = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#aa59a1dc06f1bb00dc59b37d92d32d6b6">BackBufferFormat</a>;
<a name="l00601"></a>00601                 pp.BackBufferHeight = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a5ecebc829744442c2486fec7ccf258b4">BackBufferHeight</a>;
<a name="l00602"></a>00602                 pp.BackBufferWidth = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#ac724056834a50cf1abf9667fcf669ac4">BackBufferWidth</a>;
<a name="l00603"></a>00603                 pp.hDeviceWindow = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a248091d75b3eba9b67dd82eb9fb9957b">hDeviceWindow</a>;
<a name="l00604"></a>00604                 pp.EnableAutoDepthStencil = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a086a5094fedaf2d36e90d5f773d5e7af">EnableAutoDepthStencil</a>;
<a name="l00605"></a>00605                 pp.SwapEffect = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a9374b55437b94b1bbaef854fc9299d45">SwapEffect</a>;
<a name="l00606"></a>00606                 pp.MultiSampleQuality = 0;
<a name="l00607"></a>00607                 pp.MultiSampleType = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a1f57ad7da0324b3948b25b69f2431e5a">MultiSampleType</a>;
<a name="l00608"></a>00608 
<a name="l00609"></a>00609                 <span class="keywordflow">if</span> (pp.Flags &amp; D3DPRESENTFLAG_LOCKABLE_BACKBUFFER) pp.Flags ^= D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
<a name="l00610"></a>00610 
<a name="l00611"></a>00611                 pp.AutoDepthStencilFormat = D3DFMT_D24S8;
<a name="l00612"></a>00612                 pp.FullScreen_RefreshRateInHz = 0;
<a name="l00613"></a>00613                 pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
<a name="l00614"></a>00614 
<a name="l00615"></a>00615                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;Reset(&amp;pp);
<a name="l00616"></a>00616         }
<a name="l00617"></a>00617 
<a name="l00618"></a>00618         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00619"></a>00619 
<a name="l00620"></a><a class="code" href="class_fake_device.html#abb7bbc75fbeaadf16b12acdb31408a46">00620</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#abb7bbc75fbeaadf16b12acdb31408a46">Present</a>(<span class="keyword">const</span> RECT * a, <span class="keyword">const</span> RECT * b, HWND c, <span class="keyword">const</span> RGNDATA * d)
<a name="l00621"></a>00621         {
<a name="l00622"></a>00622                 
<a name="l00623"></a>00623                 <span class="comment">// Shader draw and flip</span>
<a name="l00624"></a>00624                 <span class="comment">//VoodooDX9-&gt;DrawFSQuad();</span>
<a name="l00625"></a>00625                 <span class="comment">// Draw a custom quad to the screen</span>
<a name="l00626"></a>00626                 <span class="keyword">struct </span>TLVertex
<a name="l00627"></a>00627                 {
<a name="l00628"></a>00628                         <span class="keywordtype">float</span> x, y, z, rhw;
<a name="l00629"></a>00629                         DWORD color;
<a name="l00630"></a>00630                 };
<a name="l00631"></a>00631 
<a name="l00632"></a>00632                 TLVertex vertices[] =
<a name="l00633"></a>00633                 {
<a name="l00634"></a>00634                         { -0.5f, -0.5f, 0.0f, 1.0f, 0xffff0000 },
<a name="l00635"></a>00635                         { 99.5f, -0.5f, 0.0f, 1.0f, 0xff00ff00 },
<a name="l00636"></a>00636                         { -0.5f, 99.5f, 0.0f, 1.0f, 0xff0000ff },
<a name="l00637"></a>00637                         { 99.5f, 99.5f, 0.0f, 1.0f, 0xffff0000 }
<a name="l00638"></a>00638                 };
<a name="l00639"></a>00639 
<a name="l00640"></a>00640                 this-&gt;<a class="code" href="class_fake_device.html#a543a74276836e37dc7b18302bf4eba69">mRenderState</a>.<a class="code" href="struct_fake_device_1_1_render_state.html#ad413a2dde37322132852cb3d8d61f88b">SaveState</a>(this-&gt;<a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>);
<a name="l00641"></a>00641                 HRESULT overlay = <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;BeginScene();
<a name="l00642"></a>00642                 <span class="keywordflow">if</span> ( SUCCEEDED(overlay) )
<a name="l00643"></a>00643                 {
<a name="l00644"></a>00644                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetVertexShader(0);
<a name="l00645"></a>00645                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetPixelShader(0);
<a name="l00646"></a>00646                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
<a name="l00647"></a>00647                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetRenderState(D3DRS_ZENABLE, <span class="keyword">false</span>);
<a name="l00648"></a>00648                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
<a name="l00649"></a>00649                         <span class="comment">//RealDevice-&gt;SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);</span>
<a name="l00650"></a>00650                         <span class="comment">//RealDevice-&gt;SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE);</span>
<a name="l00651"></a>00651                         <span class="comment">//RealDevice-&gt;SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);</span>
<a name="l00652"></a>00652                         <span class="comment">//RealDevice-&gt;SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);</span>
<a name="l00653"></a>00653                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, vertices, <span class="keyword">sizeof</span>(TLVertex));
<a name="l00654"></a>00654                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetRenderState(D3DRS_ZENABLE, <span class="keyword">true</span>);
<a name="l00655"></a>00655                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;EndScene();
<a name="l00656"></a>00656                 } <span class="keywordflow">else</span> {
<a name="l00657"></a>00657                         VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: Error starting overlay scene: %d\n&quot;</span>).With(overlay).Done();
<a name="l00658"></a>00658                 }
<a name="l00659"></a>00659 
<a name="l00660"></a>00660                 this-&gt;<a class="code" href="class_fake_device.html#a543a74276836e37dc7b18302bf4eba69">mRenderState</a>.<a class="code" href="struct_fake_device_1_1_render_state.html#a46eafe88e74ef55ae1e0791433c2d115">RestoreState</a>(this-&gt;<a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>);
<a name="l00661"></a>00661 
<a name="l00662"></a>00662                 <span class="comment">//if (DepthTexture) RealDevice-&gt;SetDepthStencilSurface (DepthBuffer);</span>
<a name="l00663"></a>00663                 HRESULT hr = this-&gt;<a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;Present(a, b, c, d);
<a name="l00664"></a>00664                 <span class="keywordflow">return</span> hr;
<a name="l00665"></a>00665         }
<a name="l00666"></a>00666 
<a name="l00667"></a>00667         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00668"></a>00668 
<a name="l00669"></a><a class="code" href="class_fake_device.html#a00b30437aee7515bd6c3db9cd88cfdc3">00669</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a00b30437aee7515bd6c3db9cd88cfdc3">GetBackBuffer</a>(UINT a, D3DBACKBUFFER_TYPE b, IDirect3DSurface8 ** c) 
<a name="l00670"></a>00670         {
<a name="l00671"></a>00671                 IDirect3DSurface9 * c2 = NULL;
<a name="l00672"></a>00672                 *c = NULL;
<a name="l00673"></a>00673                 DWORD unused = 4;
<a name="l00674"></a>00674 
<a name="l00675"></a>00675                 HRESULT hr = <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetBackBuffer(0, a, b, &amp;c2);
<a name="l00676"></a>00676                 <span class="keywordflow">if</span> (hr != D3D_OK || c2 == NULL) 
<a name="l00677"></a>00677                 {
<a name="l00678"></a>00678                         <span class="keywordflow">return</span> hr;
<a name="l00679"></a>00679                 }
<a name="l00680"></a>00680 
<a name="l00681"></a>00681                 hr = c2-&gt;GetPrivateData (<a class="code" href="_wrapper_8hpp.html#aa9ea26faccd0670ffca16d885f3f2b94">guid</a>, (<span class="keywordtype">void</span> *)c, &amp;unused);
<a name="l00682"></a>00682                 <span class="keywordflow">if</span> (hr != D3D_OK) *c = <span class="keyword">new</span> <a class="code" href="class_fake_surface.html">FakeSurface</a> (c2);
<a name="l00683"></a>00683 
<a name="l00684"></a>00684                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00685"></a>00685         }
<a name="l00686"></a>00686 
<a name="l00687"></a>00687         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00688"></a>00688 
<a name="l00689"></a><a class="code" href="class_fake_device.html#a9d65f5e8461802686fc2c551ee40c818">00689</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a9d65f5e8461802686fc2c551ee40c818">GetRasterStatus</a>(D3DRASTER_STATUS * a)
<a name="l00690"></a>00690         {
<a name="l00691"></a>00691                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetRasterStatus(0, a);
<a name="l00692"></a>00692         }
<a name="l00693"></a>00693 
<a name="l00694"></a>00694         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00695"></a>00695 
<a name="l00696"></a><a class="code" href="class_fake_device.html#a42a8a08f79eef5cde11f31d34cb659b0">00696</a>         <span class="keywordtype">void</span> _stdcall <a class="code" href="class_fake_device.html#a42a8a08f79eef5cde11f31d34cb659b0">SetGammaRamp</a>(DWORD a, <span class="keyword">const</span> D3DGAMMARAMP *b)
<a name="l00697"></a>00697         {
<a name="l00698"></a>00698                 <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetGammaRamp(0, a, b);
<a name="l00699"></a>00699         }
<a name="l00700"></a>00700 
<a name="l00701"></a>00701         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00702"></a>00702 
<a name="l00703"></a><a class="code" href="class_fake_device.html#a475da93f12bc02d3b3261cca0af615d4">00703</a>         <span class="keywordtype">void</span> _stdcall <a class="code" href="class_fake_device.html#a475da93f12bc02d3b3261cca0af615d4">GetGammaRamp</a>(D3DGAMMARAMP *a)
<a name="l00704"></a>00704         {
<a name="l00705"></a>00705                 <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetGammaRamp(0, a);
<a name="l00706"></a>00706         }
<a name="l00707"></a>00707 
<a name="l00708"></a>00708         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00709"></a>00709 
<a name="l00710"></a><a class="code" href="class_fake_device.html#a3c49e245e7979d9536561c85ff7ef429">00710</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a3c49e245e7979d9536561c85ff7ef429">CreateTexture</a>(UINT a, UINT b, UINT c, DWORD d, D3DFORMAT e, D3DPOOL f, IDirect3DTexture8 ** g)
<a name="l00711"></a>00711         {
<a name="l00712"></a>00712                 <span class="comment">// Need to prepare hooks for manually-read data</span>
<a name="l00713"></a>00713 
<a name="l00714"></a>00714                 IDirect3DTexture9 *g2 = NULL;
<a name="l00715"></a>00715                 HRESULT hr = <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;CreateTexture (a, b, c, d, e, f, &amp;g2, NULL);
<a name="l00716"></a>00716                 <span class="keywordflow">if</span> (hr != D3D_OK || g2 == NULL) <span class="keywordflow">return</span> hr;
<a name="l00717"></a>00717                 *g = <span class="keyword">new</span> <a class="code" href="class_fake_texture.html">FakeTexture</a> (g2);
<a name="l00718"></a>00718                 <span class="comment">//*g = g2;</span>
<a name="l00719"></a>00719                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00720"></a>00720         }
<a name="l00721"></a>00721 
<a name="l00722"></a>00722         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00723"></a>00723 
<a name="l00727"></a><a class="code" href="class_fake_device.html#ac27d618be0ed23742e1e3cfbd77a1f3a">00727</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ac27d618be0ed23742e1e3cfbd77a1f3a">CreateVolumeTexture</a>(UINT a, UINT b, UINT c, UINT d, DWORD e, D3DFORMAT f, D3DPOOL g, <a class="code" href="_wrapper_8hpp.html#aa493e10599cbc9093b2585ac50e25eca">IDirect3DVolumeTexture8</a> ** h)
<a name="l00728"></a>00728         {
<a name="l00729"></a>00729                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l00730"></a>00730         }
<a name="l00731"></a>00731 
<a name="l00732"></a>00732         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00733"></a>00733 
<a name="l00737"></a><a class="code" href="class_fake_device.html#a6d10ba01ecc4b9f38cf19bb965a1e064">00737</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a6d10ba01ecc4b9f38cf19bb965a1e064">CreateCubeTexture</a>(UINT a, UINT b, DWORD c, D3DFORMAT d, D3DPOOL e, <a class="code" href="_wrapper_8hpp.html#a2c19c14939d1ffb3f7991fdbb468181e">IDirect3DCubeTexture8</a> ** f)
<a name="l00738"></a>00738         {
<a name="l00739"></a>00739                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l00740"></a>00740         }
<a name="l00741"></a>00741 
<a name="l00742"></a>00742         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00743"></a>00743 
<a name="l00744"></a><a class="code" href="class_fake_device.html#af6d8afecf8c5ecb0880cb00dc35c0136">00744</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#af6d8afecf8c5ecb0880cb00dc35c0136">CreateVertexBuffer</a> (UINT a, DWORD b, DWORD c, D3DPOOL d, <a class="code" href="_wrapper_8hpp.html#a2948e9a89ece242fca10c57037f70e4b">IDirect3DVertexBuffer8</a> **e) {
<a name="l00745"></a>00745                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;CreateVertexBuffer (a, b, c, d, (IDirect3DVertexBuffer9 **)e, NULL);
<a name="l00746"></a>00746         }
<a name="l00747"></a>00747 
<a name="l00748"></a>00748         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00749"></a>00749 
<a name="l00750"></a><a class="code" href="class_fake_device.html#ab8e01c6f6f925f9cd47c5cf0a4d73e6a">00750</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ab8e01c6f6f925f9cd47c5cf0a4d73e6a">CreateIndexBuffer</a> (UINT a, DWORD b, D3DFORMAT c, D3DPOOL d, <a class="code" href="_wrapper_8hpp.html#a2bba8b27146a002a78736dd4e1c75e3d">IDirect3DIndexBuffer8</a> **e) {
<a name="l00751"></a>00751                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;CreateIndexBuffer (a, b, c, d, (IDirect3DIndexBuffer9 **)e, NULL);
<a name="l00752"></a>00752         }
<a name="l00753"></a>00753 
<a name="l00754"></a>00754         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00755"></a>00755 
<a name="l00756"></a><a class="code" href="class_fake_device.html#aca11b82afdc1cb8a90a2377a662c180c">00756</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#aca11b82afdc1cb8a90a2377a662c180c">CreateRenderTarget</a> (UINT a, UINT b, D3DFORMAT c, D3DMULTISAMPLE_TYPE d, BOOL e, IDirect3DSurface8 **f) {
<a name="l00757"></a>00757                 IDirect3DSurface9 *f2 = NULL;
<a name="l00758"></a>00758                 HRESULT hr = <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;CreateRenderTarget (a, b, c, d, 0, e, &amp;f2, NULL);
<a name="l00759"></a>00759                 <span class="keywordflow">if</span> (hr != D3D_OK || f2 == NULL) <span class="keywordflow">return</span> hr;
<a name="l00760"></a>00760                 *f = <span class="keyword">new</span> <a class="code" href="class_fake_surface.html">FakeSurface</a> (f2);
<a name="l00761"></a>00761                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00762"></a>00762         }
<a name="l00763"></a>00763 
<a name="l00764"></a>00764         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00765"></a>00765 
<a name="l00766"></a><a class="code" href="class_fake_device.html#ab6de6914c4821c75ea81e0435d2828b8">00766</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ab6de6914c4821c75ea81e0435d2828b8">CreateDepthStencilSurface</a> (UINT a, UINT b, D3DFORMAT c, D3DMULTISAMPLE_TYPE d, IDirect3DSurface8 **e) {
<a name="l00767"></a>00767                 <span class="comment">//Not sure if Discard should be true or false</span>
<a name="l00768"></a>00768                 IDirect3DSurface9 *e2 = NULL;
<a name="l00769"></a>00769                 HRESULT hr = <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;CreateDepthStencilSurface (a, b, c, d, 0, <span class="keyword">false</span>, &amp;e2, NULL);
<a name="l00770"></a>00770                 <span class="keywordflow">if</span> (hr != D3D_OK) <span class="keywordflow">return</span> hr;
<a name="l00771"></a>00771                 *e = <span class="keyword">new</span> <a class="code" href="class_fake_surface.html">FakeSurface</a> (e2);
<a name="l00772"></a>00772                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00773"></a>00773         }
<a name="l00774"></a>00774 
<a name="l00775"></a>00775         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00776"></a>00776 
<a name="l00777"></a><a class="code" href="class_fake_device.html#a0a23bd9e317f07eab1a80d5f7a5ea1a0">00777</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a0a23bd9e317f07eab1a80d5f7a5ea1a0">CreateImageSurface</a> (UINT a, UINT b, D3DFORMAT c, IDirect3DSurface8 **d) {
<a name="l00778"></a>00778                 IDirect3DSurface9 *d2 = NULL;
<a name="l00779"></a>00779                 <span class="comment">//Use default to get stretchrect to work, scratch otherwise</span>
<a name="l00780"></a>00780                 HRESULT hr = <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;CreateOffscreenPlainSurface (a, b, c, D3DPOOL_SYSTEMMEM, &amp;d2, NULL);
<a name="l00781"></a>00781                 <span class="comment">//HRESULT hr = RealDevice-&gt;CreateOffscreenPlainSurface (a, b, c, D3DPOOL_DEFAULT, &amp;d2, NULL);</span>
<a name="l00782"></a>00782                 <span class="keywordflow">if</span> (hr != D3D_OK || d2 == NULL) <span class="keywordflow">return</span> hr;
<a name="l00783"></a>00783                 *d = <span class="keyword">new</span> <a class="code" href="class_fake_surface.html">FakeSurface</a> (d2);
<a name="l00784"></a>00784                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00785"></a>00785         }
<a name="l00786"></a>00786 
<a name="l00787"></a>00787         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00788"></a>00788 
<a name="l00789"></a><a class="code" href="class_fake_device.html#a5a09ef15f6d87f3b32cab8c26a5eb099">00789</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a5a09ef15f6d87f3b32cab8c26a5eb099">CopyRects</a> (IDirect3DSurface8 *a, <span class="keyword">const</span> RECT *b, UINT c, IDirect3DSurface8 *d, <span class="keyword">const</span> POINT *e) {
<a name="l00790"></a>00790                 IDirect3DSurface9 *a2 = ((<a class="code" href="class_fake_surface.html">FakeSurface</a> *)a)-&gt;mRealObject;
<a name="l00791"></a>00791                 IDirect3DSurface9 *d2 = ((<a class="code" href="class_fake_surface.html">FakeSurface</a> *)d)-&gt;mRealObject;
<a name="l00792"></a>00792                 <span class="keywordflow">if</span> (b == NULL &amp;&amp; e == NULL) {
<a name="l00793"></a>00793                         <a class="code" href="_wrapper_8hpp.html#a132529751fafeef0a55786b7893eb63c">D3DSURFACE_DESC9</a> source;
<a name="l00794"></a>00794                         <a class="code" href="_wrapper_8hpp.html#a132529751fafeef0a55786b7893eb63c">D3DSURFACE_DESC9</a> dest;
<a name="l00795"></a>00795                         <span class="keywordflow">if</span> (a2-&gt;GetDesc (&amp;source) != D3D_OK || d2-&gt;GetDesc (&amp;dest) != D3D_OK) {
<a name="l00796"></a>00796                                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l00797"></a>00797                         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (source.Usage == 1 &amp;&amp; dest.Usage == 0) {
<a name="l00798"></a>00798                                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetRenderTargetData (a2, d2);
<a name="l00799"></a>00799                         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (source.Usage == 0 &amp;&amp; dest.Usage == 1) {
<a name="l00800"></a>00800                                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;UpdateSurface (a2, NULL, d2, NULL);
<a name="l00801"></a>00801                         } <span class="keywordflow">else</span> {
<a name="l00802"></a>00802                                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;StretchRect (a2, NULL, d2, NULL, D3DTEXF_NONE);
<a name="l00803"></a>00803                         }
<a name="l00804"></a>00804                 } <span class="keywordflow">else</span> {
<a name="l00805"></a>00805                         <span class="comment">//Really cant be bothered to get this working unless absolutely neccessery</span>
<a name="l00806"></a>00806                         <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l00807"></a>00807                         <span class="comment">/* HRESULT hr;</span>
<a name="l00808"></a>00808 <span class="comment">                        RECT r;</span>
<a name="l00809"></a>00809 <span class="comment">                        r.top = e-&gt;y;</span>
<a name="l00810"></a>00810 <span class="comment">                        r.left = e-&gt;x;</span>
<a name="l00811"></a>00811 <span class="comment">                        for (UINT i = 0; i &lt; c; ++i) {</span>
<a name="l00812"></a>00812 <span class="comment">                        r.bottom = r.top + b [i].bottom - b [i].top;</span>
<a name="l00813"></a>00813 <span class="comment">                        r.right = r.left + b [i].right - b [i].left;</span>
<a name="l00814"></a>00814 <span class="comment">                        hr = RealDevice-&gt;StretchRect (a2, &amp;b [i], d2, &amp;r, D3DTEXF_LINEAR);</span>
<a name="l00815"></a>00815 <span class="comment">                        }</span>
<a name="l00816"></a>00816 <span class="comment">                        return hr; */</span>
<a name="l00817"></a>00817                 }
<a name="l00818"></a>00818         }
<a name="l00819"></a>00819 
<a name="l00820"></a>00820         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00821"></a>00821 
<a name="l00822"></a><a class="code" href="class_fake_device.html#adbfcbdf9794eabff822e29bb383bfb8f">00822</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#adbfcbdf9794eabff822e29bb383bfb8f">UpdateTexture</a> (<a class="code" href="_wrapper_8hpp.html#acbe0a01d656e8a3c57aab59a6b446ce2">IDirect3DBaseTexture8</a> *a, <a class="code" href="_wrapper_8hpp.html#acbe0a01d656e8a3c57aab59a6b446ce2">IDirect3DBaseTexture8</a> *b) {
<a name="l00823"></a>00823                 IDirect3DTexture9 *a2 = ((<a class="code" href="class_fake_texture.html">FakeTexture</a> *)a)-&gt;mRealObject;
<a name="l00824"></a>00824                 IDirect3DTexture9 *b2 = ((<a class="code" href="class_fake_texture.html">FakeTexture</a> *)b)-&gt;mRealObject;
<a name="l00825"></a>00825                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;UpdateTexture (a2, b2);
<a name="l00826"></a>00826         }
<a name="l00827"></a>00827 
<a name="l00828"></a>00828         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00829"></a>00829 
<a name="l00833"></a><a class="code" href="class_fake_device.html#a5a1975f3dc0edd3eafb3c30ad4645838">00833</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a5a1975f3dc0edd3eafb3c30ad4645838">GetFrontBuffer</a> (IDirect3DSurface8 *a) {
<a name="l00834"></a>00834                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l00835"></a>00835         }
<a name="l00836"></a>00836 
<a name="l00837"></a>00837         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00838"></a>00838 
<a name="l00839"></a><a class="code" href="class_fake_device.html#a7a5c882329288742c9230b3a40a5bea0">00839</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a7a5c882329288742c9230b3a40a5bea0">SetRenderTarget</a> (IDirect3DSurface8 *a, IDirect3DSurface8 *b) {
<a name="l00840"></a>00840                 <span class="comment">//wrapper_log_file &lt;&lt; &quot;Setting Render target to &quot; &lt;&lt; (unsigned int)a &lt;&lt; &quot; at time &quot; &lt;&lt; GetTickCount () &lt;&lt; endl;</span>
<a name="l00841"></a>00841                 IDirect3DSurface9 *a2 = NULL;
<a name="l00842"></a>00842                 IDirect3DSurface9 *b2 = NULL;
<a name="l00843"></a>00843                 <span class="keywordflow">if</span> (a != NULL) a2 = ((<a class="code" href="class_fake_surface.html">FakeSurface</a> *)a)-&gt;mRealObject;
<a name="l00844"></a>00844                 <span class="keywordflow">if</span> (b != NULL) b2 = ((<a class="code" href="class_fake_surface.html">FakeSurface</a> *)b)-&gt;mRealObject;
<a name="l00845"></a>00845                 HRESULT hr = D3D_OK;
<a name="l00846"></a>00846                 <span class="keywordflow">if</span> (a2 != NULL) hr |= <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetRenderTarget (0, a2);
<a name="l00847"></a>00847                 hr |= <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetDepthStencilSurface (b2);
<a name="l00848"></a>00848                 <span class="keywordflow">return</span> hr;
<a name="l00849"></a>00849         }
<a name="l00850"></a>00850 
<a name="l00851"></a>00851         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00852"></a>00852 
<a name="l00853"></a>00853         <span class="comment">// Voodoo DX8.9 ---------------------------------------------------</span>
<a name="l00861"></a>00861 <span class="comment"></span>        <span class="comment">/*HRESULT _stdcall GetRenderTarget(IDirect3DSurface8 ** surface)</span>
<a name="l00862"></a>00862 <span class="comment">        {</span>
<a name="l00863"></a>00863 <span class="comment">                IDirect3DSurface9 * realSurface = NULL;</span>
<a name="l00864"></a>00864 <span class="comment">                *surface = NULL;</span>
<a name="l00865"></a>00865 <span class="comment">                DWORD unused = 4;</span>
<a name="l00866"></a>00866 <span class="comment"></span>
<a name="l00867"></a>00867 <span class="comment">                HRESULT hr = RealDevice-&gt;GetRenderTarget(0, &amp;realSurface);</span>
<a name="l00868"></a>00868 <span class="comment"></span>
<a name="l00869"></a>00869 <span class="comment">                if (hr != D3D_OK || realSurface == NULL)</span>
<a name="l00870"></a>00870 <span class="comment">                {</span>
<a name="l00871"></a>00871 <span class="comment">                        return hr;</span>
<a name="l00872"></a>00872 <span class="comment">                }</span>
<a name="l00873"></a>00873 <span class="comment"></span>
<a name="l00874"></a>00874 <span class="comment">                hr = realSurface-&gt;GetPrivateData(guid, (void *)surface, &amp;unused);</span>
<a name="l00875"></a>00875 <span class="comment"></span>
<a name="l00876"></a>00876 <span class="comment">                if (hr != D3D_OK) *surface = new FakeSurface(realSurface);</span>
<a name="l00877"></a>00877 <span class="comment"></span>
<a name="l00878"></a>00878 <span class="comment">                return D3D_OK;</span>
<a name="l00879"></a>00879 <span class="comment">        }*/</span>
<a name="l00880"></a>00880 
<a name="l00881"></a>00881         <span class="comment">// MGE ------------------------------------------------------------</span>
<a name="l00882"></a><a class="code" href="class_fake_device.html#a5a689716675146407c7b077b79e8d805">00882</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a5a689716675146407c7b077b79e8d805" title="Retrieves the current render target from this device.">GetRenderTarget</a> (IDirect3DSurface8 **a) {
<a name="l00883"></a>00883                 IDirect3DSurface9 *a2 = NULL;
<a name="l00884"></a>00884                 *a = NULL;
<a name="l00885"></a>00885                 DWORD unused = 4;
<a name="l00886"></a>00886                 HRESULT hr = <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetRenderTarget (0, &amp;a2);
<a name="l00887"></a>00887                 <span class="keywordflow">if</span> (hr != D3D_OK || a2 == NULL) <span class="keywordflow">return</span> hr;
<a name="l00888"></a>00888                 hr = a2-&gt;GetPrivateData (<a class="code" href="_wrapper_8hpp.html#aa9ea26faccd0670ffca16d885f3f2b94">guid</a>, (<span class="keywordtype">void</span> *)a, &amp;unused);
<a name="l00889"></a>00889                 <span class="keywordflow">if</span> (hr != D3D_OK) *a = <span class="keyword">new</span> <a class="code" href="class_fake_surface.html">FakeSurface</a> (a2);
<a name="l00890"></a>00890                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00891"></a>00891         }
<a name="l00892"></a>00892 
<a name="l00893"></a>00893         <span class="comment">// There are some coding style differences.</span>
<a name="l00894"></a>00894 
<a name="l00895"></a>00895         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00896"></a>00896 
<a name="l00897"></a><a class="code" href="class_fake_device.html#af23f0e06db5cdd8df9a573ee351bef89">00897</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#af23f0e06db5cdd8df9a573ee351bef89">GetDepthStencilSurface</a> (IDirect3DSurface8 **a) {
<a name="l00898"></a>00898                 IDirect3DSurface9 *a2 = NULL;
<a name="l00899"></a>00899                 *a = NULL;
<a name="l00900"></a>00900                 DWORD unused = 4;
<a name="l00901"></a>00901                 HRESULT hr = <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetDepthStencilSurface (&amp;a2);
<a name="l00902"></a>00902                 <span class="keywordflow">if</span> (hr != D3D_OK || a2 == NULL) <span class="keywordflow">return</span> hr;
<a name="l00903"></a>00903                 hr = a2-&gt;GetPrivateData (<a class="code" href="_wrapper_8hpp.html#aa9ea26faccd0670ffca16d885f3f2b94">guid</a>, (<span class="keywordtype">void</span> *)a, &amp;unused);
<a name="l00904"></a>00904                 <span class="keywordflow">if</span> (hr != D3D_OK) *a = <span class="keyword">new</span> <a class="code" href="class_fake_surface.html">FakeSurface</a> (a2);
<a name="l00905"></a>00905                 <span class="keywordflow">return</span> D3D_OK;
<a name="l00906"></a>00906         }
<a name="l00907"></a>00907 
<a name="l00908"></a>00908         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00909"></a>00909 
<a name="l00910"></a><a class="code" href="class_fake_device.html#afea449c7146e3b1a621debfa8dd83261">00910</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#afea449c7146e3b1a621debfa8dd83261">BeginScene</a> () {
<a name="l00911"></a>00911                 <span class="comment">//wraper_log_file &lt;&lt; &quot;Begin Scene. Count = &quot; &lt;&lt; (int)SceneCount &lt;&lt; &quot; AlphaScene = &quot; &lt;&lt; (int)AlphaScene &lt;&lt; std::endl;</span>
<a name="l00913"></a>00913 <span class="comment"></span>                <span class="comment">//StencilEnabled = false;</span>
<a name="l00914"></a>00914                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;BeginScene ();
<a name="l00915"></a>00915         }
<a name="l00916"></a>00916 
<a name="l00917"></a>00917         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00918"></a>00918 
<a name="l00919"></a><a class="code" href="class_fake_device.html#ade83546604f4415bc5cbbc5d472f6ab7">00919</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ade83546604f4415bc5cbbc5d472f6ab7">EndScene</a>(<span class="keywordtype">void</span>)
<a name="l00920"></a>00920         {
<a name="l00921"></a>00921                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;EndScene();
<a name="l00922"></a>00922         }
<a name="l00923"></a>00923 
<a name="l00924"></a>00924         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00925"></a>00925 
<a name="l00926"></a><a class="code" href="class_fake_device.html#aff6b0ce6bf306133cf72b0e9d79aabc8">00926</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#aff6b0ce6bf306133cf72b0e9d79aabc8">Clear</a>(DWORD a, <span class="keyword">const</span> D3DRECT *b, DWORD c, D3DCOLOR d, <span class="keywordtype">float</span> e, DWORD f)
<a name="l00927"></a>00927         {
<a name="l00928"></a>00928                 d = 0xFFF00F88;
<a name="l00929"></a>00929                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;Clear(a, b, c, d, e, f);
<a name="l00930"></a>00930         }
<a name="l00931"></a>00931 
<a name="l00932"></a>00932         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00933"></a>00933 
<a name="l00934"></a><a class="code" href="class_fake_device.html#a3765a58b93397409205030d1777e8ba4">00934</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a3765a58b93397409205030d1777e8ba4">SetTransform</a>(D3DTRANSFORMSTATETYPE a, <span class="keyword">const</span> D3DMATRIX * b)
<a name="l00935"></a>00935         {
<a name="l00936"></a>00936                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetTransform(a, b);
<a name="l00937"></a>00937         }
<a name="l00938"></a>00938 
<a name="l00939"></a>00939         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00940"></a>00940 
<a name="l00941"></a><a class="code" href="class_fake_device.html#ab3d0432c22c69f5417ec5b8ba14db72c">00941</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ab3d0432c22c69f5417ec5b8ba14db72c">GetTransform</a>(D3DTRANSFORMSTATETYPE a, D3DMATRIX *b)
<a name="l00942"></a>00942         {
<a name="l00943"></a>00943                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetTransform(a, b);
<a name="l00944"></a>00944         }
<a name="l00945"></a>00945 
<a name="l00946"></a>00946         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00947"></a>00947 
<a name="l00948"></a><a class="code" href="class_fake_device.html#ac8ff226d0e78c5bc174209220ef6df17">00948</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ac8ff226d0e78c5bc174209220ef6df17">MultiplyTransform</a>(D3DTRANSFORMSTATETYPE a, <span class="keyword">const</span> D3DMATRIX *b)
<a name="l00949"></a>00949         {
<a name="l00950"></a>00950                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;MultiplyTransform(a, b);
<a name="l00951"></a>00951         }
<a name="l00952"></a>00952 
<a name="l00953"></a>00953         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00954"></a>00954 
<a name="l00955"></a><a class="code" href="class_fake_device.html#a31658e6017574ff005f9a5770083d00e">00955</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a31658e6017574ff005f9a5770083d00e">SetViewport</a>(<span class="keyword">const</span> <a class="code" href="_wrapper_8hpp.html#aa46f00620cb88942216e9b1ef1ff2a43">D3DVIEWPORT8</a> *a)
<a name="l00956"></a>00956         {
<a name="l00957"></a>00957                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetViewport(a);
<a name="l00958"></a>00958         }
<a name="l00959"></a>00959 
<a name="l00960"></a>00960         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00961"></a>00961 
<a name="l00962"></a><a class="code" href="class_fake_device.html#a5a19cea9d7b51271cd4b49a51e62f8da">00962</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a5a19cea9d7b51271cd4b49a51e62f8da">GetViewport</a>(<a class="code" href="_wrapper_8hpp.html#aa46f00620cb88942216e9b1ef1ff2a43">D3DVIEWPORT8</a> *a)
<a name="l00963"></a>00963         {
<a name="l00964"></a>00964                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetViewport(a);
<a name="l00965"></a>00965         }
<a name="l00966"></a>00966 
<a name="l00967"></a>00967         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00968"></a>00968 
<a name="l00969"></a><a class="code" href="class_fake_device.html#aebc503fd127a0f64d6c6658cd2d13f2c">00969</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#aebc503fd127a0f64d6c6658cd2d13f2c">SetMaterial</a>(<span class="keyword">const</span> <a class="code" href="_wrapper_8hpp.html#a0365b5833d9d4a8fc3e1d20571924177">D3DMATERIAL8</a> *a)
<a name="l00970"></a>00970         {
<a name="l00971"></a>00971                 <a class="code" href="class_fake_device.html#a9637f91df83c7dcaef4ae871d6f23cc5">CurrentMaterial</a> = a;
<a name="l00972"></a>00972                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetMaterial(a);
<a name="l00973"></a>00973         }
<a name="l00974"></a>00974 
<a name="l00975"></a>00975         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00976"></a>00976 
<a name="l00977"></a><a class="code" href="class_fake_device.html#af7bcb0eb7643bd4ab5efe7c55b9126e8">00977</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#af7bcb0eb7643bd4ab5efe7c55b9126e8">GetMaterial</a>(<a class="code" href="_wrapper_8hpp.html#a0365b5833d9d4a8fc3e1d20571924177">D3DMATERIAL8</a> *a)
<a name="l00978"></a>00978         {
<a name="l00979"></a>00979                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetMaterial (a);
<a name="l00980"></a>00980         }
<a name="l00981"></a>00981 
<a name="l00982"></a>00982         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00983"></a>00983 
<a name="l00984"></a><a class="code" href="class_fake_device.html#ac5ad5c487ac158d8400bcf0e81979cea">00984</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ac5ad5c487ac158d8400bcf0e81979cea">SetLight</a>(DWORD a, <span class="keyword">const</span> <a class="code" href="_wrapper_8hpp.html#ae6d90784aa49f4cfa9c688fbf567362e">D3DLIGHT8</a> *b)
<a name="l00985"></a>00985         {
<a name="l00986"></a>00986                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetLight (a, b);
<a name="l00987"></a>00987         }
<a name="l00988"></a>00988 
<a name="l00989"></a>00989         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00990"></a>00990 
<a name="l00991"></a><a class="code" href="class_fake_device.html#ae4081365c1da5d0cbab6c0d1fece2903">00991</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ae4081365c1da5d0cbab6c0d1fece2903">GetLight</a>(DWORD a, <a class="code" href="_wrapper_8hpp.html#ae6d90784aa49f4cfa9c688fbf567362e">D3DLIGHT8</a> *b)
<a name="l00992"></a>00992         {
<a name="l00993"></a>00993                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetLight (a, b);
<a name="l00994"></a>00994         }
<a name="l00995"></a>00995 
<a name="l00996"></a>00996         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00997"></a>00997 
<a name="l00998"></a><a class="code" href="class_fake_device.html#a6221212076a982b7122258113419be63">00998</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a6221212076a982b7122258113419be63">LightEnable</a>(DWORD a, BOOL b)
<a name="l00999"></a>00999         {
<a name="l01000"></a>01000                 <span class="comment">/*if (a == 6) {</span>
<a name="l01001"></a>01001 <span class="comment">                        // Light #6 (in exteriors) is the sun</span>
<a name="l01002"></a>01002 <span class="comment">                        //SunEnabled = b;</span>
<a name="l01003"></a>01003 <span class="comment">                }*/</span>
<a name="l01004"></a>01004                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;LightEnable (a, b);
<a name="l01005"></a>01005         }
<a name="l01006"></a>01006 
<a name="l01007"></a>01007         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01008"></a>01008 
<a name="l01009"></a><a class="code" href="class_fake_device.html#ad8af60a973f810d9c33018c6fdb69148">01009</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ad8af60a973f810d9c33018c6fdb69148">GetLightEnable</a>(DWORD a, BOOL *b)
<a name="l01010"></a>01010         {
<a name="l01011"></a>01011                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetLightEnable(a, b);
<a name="l01012"></a>01012         }
<a name="l01013"></a>01013 
<a name="l01014"></a>01014         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01015"></a>01015 
<a name="l01016"></a><a class="code" href="class_fake_device.html#af583cbc7785f0039f7ab1a03533d9a23">01016</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#af583cbc7785f0039f7ab1a03533d9a23">SetClipPlane</a>(DWORD a, <span class="keyword">const</span> <span class="keywordtype">float</span> *b)
<a name="l01017"></a>01017         {
<a name="l01018"></a>01018                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetClipPlane(a, b);
<a name="l01019"></a>01019         }
<a name="l01020"></a>01020 
<a name="l01021"></a>01021         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01022"></a>01022 
<a name="l01023"></a><a class="code" href="class_fake_device.html#a8fd59e231b0183128d52a68d2c96b66d">01023</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a8fd59e231b0183128d52a68d2c96b66d">GetClipPlane</a>(DWORD a, <span class="keywordtype">float</span> *b)
<a name="l01024"></a>01024         {
<a name="l01025"></a>01025                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetClipPlane(a, b);
<a name="l01026"></a>01026         }
<a name="l01027"></a>01027 
<a name="l01028"></a>01028         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01029"></a>01029 
<a name="l01030"></a><a class="code" href="class_fake_device.html#a50056a0dd62ed74327b242ff791f120a">01030</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a50056a0dd62ed74327b242ff791f120a">SetRenderState</a>(D3DRENDERSTATETYPE type, DWORD flags)
<a name="l01031"></a>01031         {
<a name="l01032"></a>01032                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetRenderState(type, flags);
<a name="l01033"></a>01033         }
<a name="l01034"></a>01034 
<a name="l01035"></a>01035         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01036"></a>01036 
<a name="l01037"></a><a class="code" href="class_fake_device.html#a12f10a18f3c70fe5ac08986d3877d513">01037</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a12f10a18f3c70fe5ac08986d3877d513">GetRenderState</a> (D3DRENDERSTATETYPE a, DWORD *b) 
<a name="l01038"></a>01038         {
<a name="l01039"></a>01039                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetRenderState (a, b);
<a name="l01040"></a>01040         }
<a name="l01041"></a>01041 
<a name="l01042"></a>01042         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01043"></a>01043 
<a name="l01047"></a><a class="code" href="class_fake_device.html#a143c08f6fc587a42ab18c5fa198e20c8">01047</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a143c08f6fc587a42ab18c5fa198e20c8">BeginStateBlock</a> (<span class="keywordtype">void</span>) 
<a name="l01048"></a>01048         {
<a name="l01049"></a>01049                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01050"></a>01050         }
<a name="l01051"></a>01051 
<a name="l01052"></a>01052         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01053"></a>01053 
<a name="l01057"></a><a class="code" href="class_fake_device.html#ae8fbc3bad856a25c363fef36a3dc557b">01057</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ae8fbc3bad856a25c363fef36a3dc557b">EndStateBlock</a> (DWORD *a) 
<a name="l01058"></a>01058         {
<a name="l01059"></a>01059                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01060"></a>01060         }
<a name="l01061"></a>01061 
<a name="l01062"></a>01062         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01063"></a>01063 
<a name="l01067"></a><a class="code" href="class_fake_device.html#ad253649475ccb8b830c519c22aeca819">01067</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ad253649475ccb8b830c519c22aeca819">ApplyStateBlock</a> (DWORD a) 
<a name="l01068"></a>01068         {
<a name="l01069"></a>01069                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01070"></a>01070         }
<a name="l01071"></a>01071 
<a name="l01072"></a>01072         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01073"></a>01073 
<a name="l01077"></a><a class="code" href="class_fake_device.html#ab19978d271a2a798efdb3630e0c0506e">01077</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ab19978d271a2a798efdb3630e0c0506e">CaptureStateBlock</a>(DWORD a) 
<a name="l01078"></a>01078         {
<a name="l01079"></a>01079                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01080"></a>01080         }
<a name="l01081"></a>01081 
<a name="l01082"></a>01082         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01083"></a>01083 
<a name="l01087"></a><a class="code" href="class_fake_device.html#adc6db58b182be59361b585fd3facecf0">01087</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#adc6db58b182be59361b585fd3facecf0">DeleteStateBlock</a>(DWORD a) 
<a name="l01088"></a>01088         {
<a name="l01089"></a>01089                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01090"></a>01090         }
<a name="l01091"></a>01091 
<a name="l01092"></a>01092         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01093"></a>01093 
<a name="l01097"></a><a class="code" href="class_fake_device.html#a0f02b4b906c95db8feca5e03aca73df8">01097</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a0f02b4b906c95db8feca5e03aca73df8">CreateStateBlock</a>(D3DSTATEBLOCKTYPE a, DWORD *b) 
<a name="l01098"></a>01098         {
<a name="l01099"></a>01099                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01100"></a>01100         }
<a name="l01101"></a>01101 
<a name="l01102"></a>01102         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01103"></a>01103 
<a name="l01107"></a><a class="code" href="class_fake_device.html#acff74de40090f6a3b85e86361e2f25f0">01107</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#acff74de40090f6a3b85e86361e2f25f0">SetClipStatus</a>(<span class="keyword">const</span> <a class="code" href="_wrapper_8hpp.html#aea73804cdb3d0bee62eec58414ab3030">D3DCLIPSTATUS8</a> *a) 
<a name="l01108"></a>01108         {
<a name="l01109"></a>01109                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01110"></a>01110         }
<a name="l01111"></a>01111 
<a name="l01112"></a>01112         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01113"></a>01113 
<a name="l01117"></a><a class="code" href="class_fake_device.html#a93c95dab44c432625c5d72cb5d87a2df">01117</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a93c95dab44c432625c5d72cb5d87a2df">GetClipStatus</a>(<a class="code" href="_wrapper_8hpp.html#aea73804cdb3d0bee62eec58414ab3030">D3DCLIPSTATUS8</a> *a) 
<a name="l01118"></a>01118         {
<a name="l01119"></a>01119                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01120"></a>01120         }
<a name="l01121"></a>01121 
<a name="l01122"></a>01122         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01123"></a>01123 
<a name="l01127"></a><a class="code" href="class_fake_device.html#a5318f1340fb212cce6e6a92d214489d1">01127</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a5318f1340fb212cce6e6a92d214489d1">GetTexture</a>(DWORD a, <a class="code" href="_wrapper_8hpp.html#acbe0a01d656e8a3c57aab59a6b446ce2">IDirect3DBaseTexture8</a> ** b) 
<a name="l01128"></a>01128         {
<a name="l01129"></a>01129                 <span class="comment">//return RealDevice-&gt;GetTexture(a, b);</span>
<a name="l01130"></a>01130                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01131"></a>01131         }
<a name="l01132"></a>01132 
<a name="l01133"></a>01133         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01134"></a>01134 
<a name="l01135"></a><a class="code" href="class_fake_device.html#a1342c1667dde5c88d66591c972a3fa8c">01135</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a1342c1667dde5c88d66591c972a3fa8c">SetTexture</a> (DWORD a, <a class="code" href="_wrapper_8hpp.html#acbe0a01d656e8a3c57aab59a6b446ce2">IDirect3DBaseTexture8</a> *b) 
<a name="l01136"></a>01136         {
<a name="l01137"></a>01137                 <span class="comment">// Look up Texture * from our internal map and call Core::Bind</span>
<a name="l01138"></a>01138                 <span class="keywordflow">if</span> ( b )
<a name="l01139"></a>01139                 {
<a name="l01140"></a>01140                         <a class="code" href="class_fake_texture.html">FakeTexture</a> * b2 = <span class="keyword">reinterpret_cast&lt;</span><a class="code" href="class_fake_texture.html">FakeTexture</a>*<span class="keyword">&gt;</span>(b);
<a name="l01141"></a>01141                         <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetTexture(a, b2-&gt;<a class="code" href="class_fake_texture.html#a3eb6681825b07245cac5255a195c565e">mRealObject</a>);
<a name="l01142"></a>01142                 } <span class="keywordflow">else</span> {
<a name="l01143"></a>01143                         <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetTexture(a, NULL);
<a name="l01144"></a>01144                 }
<a name="l01145"></a>01145         }
<a name="l01146"></a>01146 
<a name="l01147"></a>01147         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01148"></a>01148 
<a name="l01149"></a><a class="code" href="class_fake_device.html#a5c5431c14897efc12b6b453cbfe48e0d">01149</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a5c5431c14897efc12b6b453cbfe48e0d">GetTextureStageState</a>(DWORD a, D3DTEXTURESTAGESTATETYPE b, DWORD * c)
<a name="l01150"></a>01150         {
<a name="l01151"></a>01151                 <span class="comment">//Some bugger decided to split this into two functions : (</span>
<a name="l01152"></a>01152                 D3DSAMPLERSTATETYPE sampler;
<a name="l01153"></a>01153                 <span class="keywordflow">switch</span> (b)
<a name="l01154"></a>01154                 {
<a name="l01155"></a>01155                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a8d43562532e275d490644ad884f90000">D3DTSS_ADDRESSU</a>:
<a name="l01156"></a>01156                         sampler = D3DSAMP_ADDRESSU;
<a name="l01157"></a>01157                         <span class="keywordflow">break</span>;
<a name="l01158"></a>01158                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a2e68ec68aa4a7af9e4ace40d1f233866">D3DTSS_ADDRESSV</a>:
<a name="l01159"></a>01159                         sampler = D3DSAMP_ADDRESSV;
<a name="l01160"></a>01160                         <span class="keywordflow">break</span>;
<a name="l01161"></a>01161                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a4601a7ffd35a05a0bb1d5eca6b8ac97a">D3DTSS_ADDRESSW</a>:
<a name="l01162"></a>01162                         sampler = D3DSAMP_ADDRESSW;
<a name="l01163"></a>01163                         <span class="keywordflow">break</span>;
<a name="l01164"></a>01164                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a227a9afdea6d3213620bcb2ca34992d6">D3DTSS_BORDERCOLOR</a>:
<a name="l01165"></a>01165                         sampler = D3DSAMP_BORDERCOLOR;
<a name="l01166"></a>01166                         <span class="keywordflow">break</span>;
<a name="l01167"></a>01167                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a4f621ac05922b2ea304c94e0445d5c04">D3DTSS_MAGFILTER</a>:
<a name="l01168"></a>01168                         sampler = D3DSAMP_MAGFILTER;
<a name="l01169"></a>01169                         <span class="keywordflow">break</span>;
<a name="l01170"></a>01170                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#af47ef9374011356891e48f98d00a5927">D3DTSS_MINFILTER</a>:
<a name="l01171"></a>01171                         sampler = D3DSAMP_MINFILTER;
<a name="l01172"></a>01172                         <span class="keywordflow">break</span>;
<a name="l01173"></a>01173                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a902babf5e2ed36bd04d9268a7131de3a">D3DTSS_MIPFILTER</a>:
<a name="l01174"></a>01174                         sampler = D3DSAMP_MIPFILTER;
<a name="l01175"></a>01175                         <span class="keywordflow">break</span>;
<a name="l01176"></a>01176                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a21c322668eded9b7a2e8699c20f15a0b">D3DTSS_MIPMAPLODBIAS</a>:
<a name="l01177"></a>01177                         sampler = D3DSAMP_MIPMAPLODBIAS;
<a name="l01178"></a>01178                         <span class="keywordflow">break</span>;
<a name="l01179"></a>01179                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a74c50ce3db9310a2d534b6316d4ec1c6">D3DTSS_MAXMIPLEVEL</a>:
<a name="l01180"></a>01180                         sampler = D3DSAMP_MAXMIPLEVEL;
<a name="l01181"></a>01181                         <span class="keywordflow">break</span>;
<a name="l01182"></a>01182                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#ae6d28c07fddcf9e861b3c8b6ab95ada6">D3DTSS_MAXANISOTROPY</a>:
<a name="l01183"></a>01183                         sampler = D3DSAMP_MAXANISOTROPY;
<a name="l01184"></a>01184                         <span class="keywordflow">break</span>;
<a name="l01185"></a>01185                 <span class="keywordflow">default</span>:
<a name="l01186"></a>01186                         <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetTextureStageState(a, b, c);
<a name="l01187"></a>01187                 }
<a name="l01188"></a>01188 
<a name="l01189"></a>01189                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetSamplerState(a, sampler, c);
<a name="l01190"></a>01190         }
<a name="l01191"></a>01191 
<a name="l01192"></a>01192         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01193"></a>01193 
<a name="l01194"></a><a class="code" href="class_fake_device.html#abaa97ca4e3fe168ea2077f352d1b2407">01194</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#abaa97ca4e3fe168ea2077f352d1b2407">SetTextureStageState</a> (DWORD a, D3DTEXTURESTAGESTATETYPE b, DWORD c) {
<a name="l01195"></a>01195                 <span class="comment">//if (b == 11) return D3DERR_INVALIDCALL;</span>
<a name="l01196"></a>01196                 <span class="comment">//If it&#39;s something MGE controls then override it</span>
<a name="l01197"></a>01197                 <span class="comment">/*if (a == 0) {</span>
<a name="l01198"></a>01198 <span class="comment">                        if ((b == D3DTSS_MINFILTER /*|| b == D3DTSS_MAGFILTER* /) &amp;&amp; c == 2) {</span>
<a name="l01199"></a>01199 <span class="comment">                                D3DSAMP_MINFILTER;</span>
<a name="l01200"></a>01200 <span class="comment">                                return RealDevice-&gt;SetSamplerState (0, (D3DSAMPLERSTATETYPE) (b - 11), ScaleFilter);</span>
<a name="l01201"></a>01201 <span class="comment">                        }</span>
<a name="l01202"></a>01202 <span class="comment">                        if (b == D3DTSS_MIPFILTER &amp;&amp; c == 2) {</span>
<a name="l01203"></a>01203 <span class="comment">                                return RealDevice-&gt;SetSamplerState (0, D3DSAMP_MIPFILTER, MipFilter);</span>
<a name="l01204"></a>01204 <span class="comment">                        }</span>
<a name="l01205"></a>01205 <span class="comment">                        if (b == D3DTSS_MIPMAPLODBIAS &amp;&amp; LODBias) {</span>
<a name="l01206"></a>01206 <span class="comment">                                return RealDevice-&gt;SetSamplerState (0, D3DSAMP_MIPMAPLODBIAS, *(DWORD *)&amp;LODBias);</span>
<a name="l01207"></a>01207 <span class="comment">                        }</span>
<a name="l01208"></a>01208 <span class="comment">                }*/</span>
<a name="l01209"></a>01209                 <span class="comment">//Some bugger decided to split this into two functions : (</span>
<a name="l01210"></a>01210                 D3DSAMPLERSTATETYPE sampler;
<a name="l01211"></a>01211                 <span class="keywordflow">switch</span> (b) {
<a name="l01212"></a>01212                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a8d43562532e275d490644ad884f90000">D3DTSS_ADDRESSU</a>:
<a name="l01213"></a>01213                         sampler = D3DSAMP_ADDRESSU;
<a name="l01214"></a>01214                         <span class="keywordflow">break</span>;
<a name="l01215"></a>01215                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a2e68ec68aa4a7af9e4ace40d1f233866">D3DTSS_ADDRESSV</a>:
<a name="l01216"></a>01216                         sampler = D3DSAMP_ADDRESSV;
<a name="l01217"></a>01217                         <span class="keywordflow">break</span>;
<a name="l01218"></a>01218                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a4601a7ffd35a05a0bb1d5eca6b8ac97a">D3DTSS_ADDRESSW</a>:
<a name="l01219"></a>01219                         sampler = D3DSAMP_ADDRESSW;
<a name="l01220"></a>01220                         <span class="keywordflow">break</span>;
<a name="l01221"></a>01221                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a227a9afdea6d3213620bcb2ca34992d6">D3DTSS_BORDERCOLOR</a>:
<a name="l01222"></a>01222                         sampler = D3DSAMP_BORDERCOLOR;
<a name="l01223"></a>01223                         <span class="keywordflow">break</span>;
<a name="l01224"></a>01224                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a4f621ac05922b2ea304c94e0445d5c04">D3DTSS_MAGFILTER</a>:
<a name="l01225"></a>01225                         sampler = D3DSAMP_MAGFILTER;
<a name="l01226"></a>01226                         <span class="keywordflow">break</span>;
<a name="l01227"></a>01227                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#af47ef9374011356891e48f98d00a5927">D3DTSS_MINFILTER</a>:
<a name="l01228"></a>01228                         sampler = D3DSAMP_MINFILTER;
<a name="l01229"></a>01229                         <span class="keywordflow">break</span>;
<a name="l01230"></a>01230                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a902babf5e2ed36bd04d9268a7131de3a">D3DTSS_MIPFILTER</a>:
<a name="l01231"></a>01231                         sampler = D3DSAMP_MIPFILTER;
<a name="l01232"></a>01232                         <span class="keywordflow">break</span>;
<a name="l01233"></a>01233                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a21c322668eded9b7a2e8699c20f15a0b">D3DTSS_MIPMAPLODBIAS</a>:
<a name="l01234"></a>01234                         sampler = D3DSAMP_MIPMAPLODBIAS;
<a name="l01235"></a>01235                         <span class="keywordflow">break</span>;
<a name="l01236"></a>01236                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#a74c50ce3db9310a2d534b6316d4ec1c6">D3DTSS_MAXMIPLEVEL</a>:
<a name="l01237"></a>01237                         sampler = D3DSAMP_MAXMIPLEVEL;
<a name="l01238"></a>01238                         <span class="keywordflow">break</span>;
<a name="l01239"></a>01239                 <span class="keywordflow">case</span> <a class="code" href="_wrapper_8hpp.html#ae6d28c07fddcf9e861b3c8b6ab95ada6">D3DTSS_MAXANISOTROPY</a>:
<a name="l01240"></a>01240                         sampler = D3DSAMP_MAXANISOTROPY;
<a name="l01241"></a>01241                         <span class="keywordflow">break</span>;
<a name="l01242"></a>01242                 <span class="keywordflow">default</span>:
<a name="l01243"></a>01243                         <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetTextureStageState (a, b, c);
<a name="l01244"></a>01244                 }
<a name="l01245"></a>01245                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetSamplerState (a, sampler, c);
<a name="l01246"></a>01246         }
<a name="l01247"></a>01247 
<a name="l01248"></a>01248         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01249"></a>01249 
<a name="l01250"></a><a class="code" href="class_fake_device.html#a0a6b86b76b073e42c4633f628450e876">01250</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a0a6b86b76b073e42c4633f628450e876">ValidateDevice</a> (DWORD *a) {
<a name="l01251"></a>01251                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;ValidateDevice (a);
<a name="l01252"></a>01252         }
<a name="l01253"></a>01253 
<a name="l01254"></a>01254         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01255"></a>01255 
<a name="l01256"></a><a class="code" href="class_fake_device.html#a11daf960c760a8d2fb5b83c3db1b1377">01256</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a11daf960c760a8d2fb5b83c3db1b1377">GetInfo</a> (DWORD a, <span class="keywordtype">void</span> *b, DWORD c) {
<a name="l01257"></a>01257                 <span class="comment">//Doesn&#39;t seem to have a DX9 equivilent</span>
<a name="l01258"></a>01258                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01259"></a>01259         }
<a name="l01260"></a>01260 
<a name="l01261"></a>01261         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01262"></a>01262 
<a name="l01263"></a><a class="code" href="class_fake_device.html#ab2c3d825f8e0c22e0d806fd33d9d1dd4">01263</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ab2c3d825f8e0c22e0d806fd33d9d1dd4">SetPaletteEntries</a> (UINT a, <span class="keyword">const</span> PALETTEENTRY *b) {
<a name="l01264"></a>01264                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetPaletteEntries (a, b);
<a name="l01265"></a>01265         }
<a name="l01266"></a>01266 
<a name="l01267"></a>01267         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01268"></a>01268 
<a name="l01269"></a><a class="code" href="class_fake_device.html#af4fdfa8335c0b4e46564a1cad7e44f3c">01269</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#af4fdfa8335c0b4e46564a1cad7e44f3c">GetPaletteEntries</a> (UINT a, PALETTEENTRY *b) {
<a name="l01270"></a>01270                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetPaletteEntries (a, b);
<a name="l01271"></a>01271         }
<a name="l01272"></a>01272 
<a name="l01273"></a>01273         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01274"></a>01274 
<a name="l01275"></a><a class="code" href="class_fake_device.html#af5b0199d8aef0d3adb41130f3529ed32">01275</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#af5b0199d8aef0d3adb41130f3529ed32">SetCurrentTexturePalette</a> (UINT a) {
<a name="l01276"></a>01276                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetCurrentTexturePalette (a);
<a name="l01277"></a>01277         }
<a name="l01278"></a>01278 
<a name="l01279"></a>01279         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01280"></a>01280 
<a name="l01281"></a><a class="code" href="class_fake_device.html#aa09dc5bbc5ed6b10cd985a9a572e74d1">01281</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#aa09dc5bbc5ed6b10cd985a9a572e74d1">GetCurrentTexturePalette</a> (UINT *a) {
<a name="l01282"></a>01282                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetCurrentTexturePalette (a);
<a name="l01283"></a>01283         }
<a name="l01284"></a>01284 
<a name="l01285"></a>01285         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01286"></a>01286 
<a name="l01287"></a><a class="code" href="class_fake_device.html#a5a9d24c069e5ee3f10d604ce2c826639">01287</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a5a9d24c069e5ee3f10d604ce2c826639">DrawPrimitive</a> (D3DPRIMITIVETYPE a, UINT b, UINT c) {
<a name="l01288"></a>01288                 <span class="comment">/*++NumDrawCalls;</span>
<a name="l01289"></a>01289 <span class="comment"></span>
<a name="l01290"></a>01290 <span class="comment">                if (HookedShaderActive &gt; 1) {</span>
<a name="l01291"></a>01291 <span class="comment">                        HRESULT hr = 0;</span>
<a name="l01292"></a>01292 <span class="comment">                        for (DWORD i = 0; i &lt; HookedShaderActive; ++i) {</span>
<a name="l01293"></a>01293 <span class="comment">                                ShaderStruct.MWSEeffects [ActiveHookedShader].effect-&gt;BeginPass (i);</span>
<a name="l01294"></a>01294 <span class="comment">                                hr |= RealDevice-&gt;DrawPrimitive (a, b, c);</span>
<a name="l01295"></a>01295 <span class="comment">                        }</span>
<a name="l01296"></a>01296 <span class="comment">                        return hr;</span>
<a name="l01297"></a>01297 <span class="comment">                }</span>
<a name="l01298"></a>01298 <span class="comment"></span>
<a name="l01299"></a>01299 <span class="comment">                //Record the render if recording is turned on</span>
<a name="l01300"></a>01300 <span class="comment">                if (!(CurrentDestBlend == D3DBLEND_ONE &amp;&amp; AlphaBlendEnabled) &amp;&amp; zWriteEnabled &amp;&amp; !HUDRenderingStarted</span>
<a name="l01301"></a>01301 <span class="comment">                        &amp;&amp; RecordRenders &amp;&amp; !StencilEnabled &amp;&amp; !RenderingToTexture</span>
<a name="l01302"></a>01302 <span class="comment">                ) {</span>
<a name="l01303"></a>01303 <span class="comment">                        DrawRecorder::RecordedDrawCall rdc;</span>
<a name="l01304"></a>01304 <span class="comment">                        rdc.material = CurrentMaterial;</span>
<a name="l01305"></a>01305 <span class="comment">                        rdc.texture = CurrentTexture;</span>
<a name="l01306"></a>01306 <span class="comment">                        rdc.vBuffer = CurrentVBuffer;</span>
<a name="l01307"></a>01307 <span class="comment">                        rdc.streamSpan = CurrentStreamSpan;</span>
<a name="l01308"></a>01308 <span class="comment">                        rdc.indices = CurrentIndices;</span>
<a name="l01309"></a>01309 <span class="comment">                        rdc.fvf = CurrentFVF;</span>
<a name="l01310"></a>01310 <span class="comment">                        rdc.vertexBlendState = CurrentVertexBlendState;</span>
<a name="l01311"></a>01311 <span class="comment">                        rdc.worldTrans [0] = CurrentWorldTrans;</span>
<a name="l01312"></a>01312 <span class="comment">                        rdc.worldTrans [1] = CurrentBlendTrans1;</span>
<a name="l01313"></a>01313 <span class="comment">                        rdc.worldTrans [2] = CurrentBlendTrans2;</span>
<a name="l01314"></a>01314 <span class="comment">                        rdc.worldTrans [3] = CurrentBlendTrans3;</span>
<a name="l01315"></a>01315 <span class="comment">                        rdc.cullModeState = CurrentCullModeState;</span>
<a name="l01316"></a>01316 <span class="comment">                        rdc.alphaBlendEnabled = AlphaBlendEnabled;</span>
<a name="l01317"></a>01317 <span class="comment">                        rdc.alphaTestEnabled = AlphaTestEnabled;</span>
<a name="l01318"></a>01318 <span class="comment">                        rdc.alphaBlendFunc = CurrentSrcBlend;</span>
<a name="l01319"></a>01319 <span class="comment"></span>
<a name="l01320"></a>01320 <span class="comment">                        rdc.renderType = DrawRecorder::DRAW_PRIM;</span>
<a name="l01321"></a>01321 <span class="comment">                        rdc.primType = a;</span>
<a name="l01322"></a>01322 <span class="comment">                        rdc.startIndex = b;</span>
<a name="l01323"></a>01323 <span class="comment">                        rdc.primitiveCount = c;</span>
<a name="l01324"></a>01324 <span class="comment"></span>
<a name="l01325"></a>01325 <span class="comment">                        DepthDrawRecorder.RecordDrawCall(rdc);</span>
<a name="l01326"></a>01326 <span class="comment">                }*/</span>
<a name="l01327"></a>01327                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;DrawPrimitive (a, b, c);
<a name="l01328"></a>01328         }
<a name="l01329"></a>01329 
<a name="l01330"></a>01330         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01331"></a>01331 
<a name="l01332"></a><a class="code" href="class_fake_device.html#a67caa0ba85628dfa824a18d1f1354ece">01332</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a67caa0ba85628dfa824a18d1f1354ece">DrawIndexedPrimitive</a> (D3DPRIMITIVETYPE a, UINT b, UINT c, UINT d, UINT e) {
<a name="l01333"></a>01333                 <span class="comment">//++NumDrawCalls;</span>
<a name="l01334"></a>01334 
<a name="l01336"></a>01336                 <span class="comment">//if (StencilEnabled &amp;&amp; AlphaBlendEnabled &amp;&amp; a == D3DPT_TRIANGLELIST &amp;&amp; b == 0 &amp;&amp; c == 4 &amp;&amp; d == 0 &amp;&amp; e == 2) {</span>
<a name="l01337"></a>01337                 <span class="comment">//      ShadowPlaneDrawn = true;</span>
<a name="l01338"></a>01338                 <span class="comment">//      wrapper_log_file &lt;&lt; &quot;Shadow Plane Drawn during scene &quot; &lt;&lt; int (SceneCount) &lt;&lt; &quot; after &quot; &lt;&lt; int (ShadowsDrawn) &lt;&lt; &quot; shadows drawn.&quot; &lt;&lt; endl;</span>
<a name="l01339"></a>01339                 <span class="comment">//}</span>
<a name="l01340"></a>01340 
<a name="l01341"></a>01341                 <span class="comment">//Record the render if recording is turned on</span>
<a name="l01342"></a>01342                 <span class="comment">/*if (!(CurrentDestBlend == D3DBLEND_ONE &amp;&amp; AlphaBlendEnabled) &amp;&amp; zWriteEnabled &amp;&amp; !HUDRenderingStarted</span>
<a name="l01343"></a>01343 <span class="comment">                        &amp;&amp; RecordRenders &amp;&amp; !StencilEnabled &amp;&amp; !RenderingToTexture</span>
<a name="l01344"></a>01344 <span class="comment">                ) {</span>
<a name="l01345"></a>01345 <span class="comment">                        DrawRecorder::RecordedDrawCall rdc;</span>
<a name="l01346"></a>01346 <span class="comment">                        rdc.material = CurrentMaterial;</span>
<a name="l01347"></a>01347 <span class="comment">                        rdc.texture = CurrentTexture;</span>
<a name="l01348"></a>01348 <span class="comment">                        rdc.vBuffer = CurrentVBuffer;</span>
<a name="l01349"></a>01349 <span class="comment">                        rdc.streamSpan = CurrentStreamSpan;</span>
<a name="l01350"></a>01350 <span class="comment">                        rdc.indices = CurrentIndices;</span>
<a name="l01351"></a>01351 <span class="comment">                        rdc.fvf = CurrentFVF;</span>
<a name="l01352"></a>01352 <span class="comment">                        rdc.vertexBlendState = CurrentVertexBlendState;</span>
<a name="l01353"></a>01353 <span class="comment">                        rdc.worldTrans [0] = CurrentWorldTrans;</span>
<a name="l01354"></a>01354 <span class="comment">                        rdc.worldTrans [1] = CurrentBlendTrans1;</span>
<a name="l01355"></a>01355 <span class="comment">                        rdc.worldTrans [2] = CurrentBlendTrans2;</span>
<a name="l01356"></a>01356 <span class="comment">                        rdc.worldTrans [3] = CurrentBlendTrans3;</span>
<a name="l01357"></a>01357 <span class="comment">                        rdc.cullModeState = CurrentCullModeState;</span>
<a name="l01358"></a>01358 <span class="comment">                        rdc.alphaBlendEnabled = AlphaBlendEnabled;</span>
<a name="l01359"></a>01359 <span class="comment">                        rdc.alphaTestEnabled = AlphaTestEnabled;</span>
<a name="l01360"></a>01360 <span class="comment">                        rdc.alphaBlendFunc = CurrentSrcBlend;</span>
<a name="l01361"></a>01361 <span class="comment"></span>
<a name="l01362"></a>01362 <span class="comment">                        rdc.renderType = DrawRecorder::DRAW_INDEXED;</span>
<a name="l01363"></a>01363 <span class="comment">                        rdc.primType = a;</span>
<a name="l01364"></a>01364 <span class="comment">                        rdc.baseVertexIndex = BaseVertexIndex;</span>
<a name="l01365"></a>01365 <span class="comment">                        rdc.minIndex = b;</span>
<a name="l01366"></a>01366 <span class="comment">                        rdc.numVertices = c;</span>
<a name="l01367"></a>01367 <span class="comment">                        rdc.startIndex = d;</span>
<a name="l01368"></a>01368 <span class="comment">                        rdc.primitiveCount = e;</span>
<a name="l01369"></a>01369 <span class="comment"></span>
<a name="l01370"></a>01370 <span class="comment">                        DepthDrawRecorder.RecordDrawCall(rdc);</span>
<a name="l01371"></a>01371 <span class="comment"></span>
<a name="l01372"></a>01372 <span class="comment">                        //D3DXMatrixIdentity (&amp;CurrentBlendTrans1);</span>
<a name="l01373"></a>01373 <span class="comment">                        //D3DXMatrixIdentity (&amp;CurrentBlendTrans2);</span>
<a name="l01374"></a>01374 <span class="comment">                        //D3DXMatrixIdentity (&amp;CurrentBlendTrans3);</span>
<a name="l01375"></a>01375 <span class="comment">                }*/</span>
<a name="l01376"></a>01376 
<a name="l01377"></a>01377                 <span class="comment">/*if (HookedShaderActive &gt; 1) {</span>
<a name="l01378"></a>01378 <span class="comment">                        HRESULT hr = 0;</span>
<a name="l01379"></a>01379 <span class="comment">                        for (DWORD i = 0; i &lt; HookedShaderActive; ++i) {</span>
<a name="l01380"></a>01380 <span class="comment">                                ShaderStruct.MWSEeffects [ActiveHookedShader].effect-&gt;BeginPass (i);</span>
<a name="l01381"></a>01381 <span class="comment">                                hr |= RealDevice-&gt;DrawIndexedPrimitive (a, BaseVertexIndex, b, c, d, e);</span>
<a name="l01382"></a>01382 <span class="comment">                        }</span>
<a name="l01383"></a>01383 <span class="comment">                        return hr;</span>
<a name="l01384"></a>01384 <span class="comment">                }*/</span>
<a name="l01385"></a>01385 
<a name="l01386"></a>01386                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;DrawIndexedPrimitive (a, <a class="code" href="class_fake_device.html#acf30afa80ffa62865b04427c91d6b206">BaseVertexIndex</a>, b, c, d, e);
<a name="l01387"></a>01387         }
<a name="l01388"></a>01388 
<a name="l01389"></a>01389         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01390"></a>01390 
<a name="l01391"></a><a class="code" href="class_fake_device.html#ab66ec5151d338fc40801a2a1592c4e38">01391</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ab66ec5151d338fc40801a2a1592c4e38">DrawPrimitiveUP</a> (D3DPRIMITIVETYPE a, UINT b, <span class="keyword">const</span> <span class="keywordtype">void</span> *c, UINT d) {
<a name="l01392"></a>01392                 <span class="comment">//++NumDrawCalls;</span>
<a name="l01393"></a>01393                 <span class="comment">/*if (HookedShaderActive &gt; 1) {</span>
<a name="l01394"></a>01394 <span class="comment">                        HRESULT hr = 0;</span>
<a name="l01395"></a>01395 <span class="comment">                        for (DWORD i = 0; i &lt; HookedShaderActive; ++i) {</span>
<a name="l01396"></a>01396 <span class="comment">                                ShaderStruct.MWSEeffects [ActiveHookedShader].effect-&gt;BeginPass (i);</span>
<a name="l01397"></a>01397 <span class="comment">                                hr |= RealDevice-&gt;DrawPrimitiveUP (a, b, c, d);</span>
<a name="l01398"></a>01398 <span class="comment">                        }</span>
<a name="l01399"></a>01399 <span class="comment">                        return hr;</span>
<a name="l01400"></a>01400 <span class="comment">                }</span>
<a name="l01401"></a>01401 <span class="comment">                //Record the render if recording is turned on</span>
<a name="l01402"></a>01402 <span class="comment">                if (!(CurrentDestBlend == D3DBLEND_ONE &amp;&amp; AlphaBlendEnabled) &amp;&amp; zWriteEnabled &amp;&amp; !HUDRenderingStarted</span>
<a name="l01403"></a>01403 <span class="comment">                        &amp;&amp; RecordRenders &amp;&amp; !StencilEnabled &amp;&amp; !RenderingToTexture</span>
<a name="l01404"></a>01404 <span class="comment">                ) {</span>
<a name="l01405"></a>01405 <span class="comment">                        DrawRecorder::RecordedDrawCall rdc;</span>
<a name="l01406"></a>01406 <span class="comment">                        rdc.material = CurrentMaterial;</span>
<a name="l01407"></a>01407 <span class="comment">                        rdc.texture = CurrentTexture;</span>
<a name="l01408"></a>01408 <span class="comment">                        rdc.vBuffer = CurrentVBuffer;</span>
<a name="l01409"></a>01409 <span class="comment">                        rdc.streamSpan = CurrentStreamSpan;</span>
<a name="l01410"></a>01410 <span class="comment">                        rdc.indices = CurrentIndices;</span>
<a name="l01411"></a>01411 <span class="comment">                        rdc.fvf = CurrentFVF;</span>
<a name="l01412"></a>01412 <span class="comment">                        rdc.vertexBlendState = CurrentVertexBlendState;</span>
<a name="l01413"></a>01413 <span class="comment">                        rdc.worldTrans [0] = CurrentWorldTrans;</span>
<a name="l01414"></a>01414 <span class="comment">                        rdc.worldTrans [1] = CurrentBlendTrans1;</span>
<a name="l01415"></a>01415 <span class="comment">                        rdc.worldTrans [2] = CurrentBlendTrans2;</span>
<a name="l01416"></a>01416 <span class="comment">                        rdc.worldTrans [3] = CurrentBlendTrans3;</span>
<a name="l01417"></a>01417 <span class="comment">                        rdc.cullModeState = CurrentCullModeState;</span>
<a name="l01418"></a>01418 <span class="comment">                        rdc.alphaBlendEnabled = AlphaBlendEnabled;</span>
<a name="l01419"></a>01419 <span class="comment">                        rdc.alphaTestEnabled = AlphaTestEnabled;</span>
<a name="l01420"></a>01420 <span class="comment">                        rdc.alphaBlendFunc = CurrentSrcBlend;</span>
<a name="l01421"></a>01421 <span class="comment"></span>
<a name="l01422"></a>01422 <span class="comment">                        rdc.renderType = DrawRecorder::DRAW_PRIM_UP;</span>
<a name="l01423"></a>01423 <span class="comment">                        rdc.primType = a;</span>
<a name="l01424"></a>01424 <span class="comment">                        rdc.primitiveCount = b;</span>
<a name="l01425"></a>01425 <span class="comment">                        rdc.vertexStreamZeroData = c;</span>
<a name="l01426"></a>01426 <span class="comment">                        rdc.vertexStreamZeroSride = d;</span>
<a name="l01427"></a>01427 <span class="comment"></span>
<a name="l01428"></a>01428 <span class="comment">                        DepthDrawRecorder.RecordDrawCall(rdc);</span>
<a name="l01429"></a>01429 <span class="comment">                }*/</span>
<a name="l01430"></a>01430                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;DrawPrimitiveUP (a, b, c, d);
<a name="l01431"></a>01431         }
<a name="l01432"></a>01432 
<a name="l01433"></a>01433         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01434"></a>01434 
<a name="l01435"></a><a class="code" href="class_fake_device.html#a57ac31c621ffa8e63f86320f51170e44">01435</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a57ac31c621ffa8e63f86320f51170e44">DrawIndexedPrimitiveUP</a> (D3DPRIMITIVETYPE a, UINT b, UINT c, UINT d, <span class="keyword">const</span> <span class="keywordtype">void</span> *e, D3DFORMAT f, <span class="keyword">const</span> <span class="keywordtype">void</span> *g, UINT h) {
<a name="l01436"></a>01436                 <span class="comment">/*++NumDrawCalls;</span>
<a name="l01437"></a>01437 <span class="comment">                if (HookedShaderActive &gt; 1) {</span>
<a name="l01438"></a>01438 <span class="comment">                        HRESULT hr = 0;</span>
<a name="l01439"></a>01439 <span class="comment">                        for (DWORD i = 0; i &lt; HookedShaderActive; ++i) {</span>
<a name="l01440"></a>01440 <span class="comment">                                ShaderStruct.MWSEeffects [ActiveHookedShader].effect-&gt;BeginPass (i);</span>
<a name="l01441"></a>01441 <span class="comment">                                hr |= RealDevice-&gt;DrawIndexedPrimitiveUP (a, b, c, d, e, f, g, h);</span>
<a name="l01442"></a>01442 <span class="comment">                        }</span>
<a name="l01443"></a>01443 <span class="comment">                        return hr;</span>
<a name="l01444"></a>01444 <span class="comment">                }</span>
<a name="l01445"></a>01445 <span class="comment"></span>
<a name="l01446"></a>01446 <span class="comment">                //Record the render if recording is turned on</span>
<a name="l01447"></a>01447 <span class="comment">                if (!(CurrentDestBlend == D3DBLEND_ONE &amp;&amp; AlphaBlendEnabled) &amp;&amp; zWriteEnabled &amp;&amp; !HUDRenderingStarted</span>
<a name="l01448"></a>01448 <span class="comment">                        &amp;&amp; RecordRenders &amp;&amp; !StencilEnabled &amp;&amp; !RenderingToTexture</span>
<a name="l01449"></a>01449 <span class="comment">                ) {</span>
<a name="l01450"></a>01450 <span class="comment">                        DrawRecorder::RecordedDrawCall rdc;</span>
<a name="l01451"></a>01451 <span class="comment"></span>
<a name="l01452"></a>01452 <span class="comment">                        rdc.material = CurrentMaterial;</span>
<a name="l01453"></a>01453 <span class="comment">                        rdc.texture = CurrentTexture;</span>
<a name="l01454"></a>01454 <span class="comment">                        rdc.vBuffer = CurrentVBuffer;</span>
<a name="l01455"></a>01455 <span class="comment">                        rdc.streamSpan = CurrentStreamSpan;</span>
<a name="l01456"></a>01456 <span class="comment">                        rdc.indices = CurrentIndices;</span>
<a name="l01457"></a>01457 <span class="comment">                        rdc.fvf = CurrentFVF;</span>
<a name="l01458"></a>01458 <span class="comment">                        rdc.vertexBlendState = CurrentVertexBlendState;</span>
<a name="l01459"></a>01459 <span class="comment">                        rdc.worldTrans [0] = CurrentWorldTrans;</span>
<a name="l01460"></a>01460 <span class="comment">                        rdc.worldTrans [1] = CurrentBlendTrans1;</span>
<a name="l01461"></a>01461 <span class="comment">                        rdc.worldTrans [2] = CurrentBlendTrans2;</span>
<a name="l01462"></a>01462 <span class="comment">                        rdc.worldTrans [3] = CurrentBlendTrans3;</span>
<a name="l01463"></a>01463 <span class="comment">                        rdc.cullModeState = CurrentCullModeState;</span>
<a name="l01464"></a>01464 <span class="comment">                        rdc.alphaBlendEnabled = AlphaBlendEnabled;</span>
<a name="l01465"></a>01465 <span class="comment">                        rdc.alphaTestEnabled = AlphaTestEnabled;</span>
<a name="l01466"></a>01466 <span class="comment">                        rdc.alphaBlendFunc = CurrentSrcBlend;</span>
<a name="l01467"></a>01467 <span class="comment"></span>
<a name="l01468"></a>01468 <span class="comment">                        rdc.renderType = DrawRecorder::DRAW_INDEXED_UP;</span>
<a name="l01469"></a>01469 <span class="comment">                        rdc.primType = a;</span>
<a name="l01470"></a>01470 <span class="comment">                        rdc.minIndex = b;</span>
<a name="l01471"></a>01471 <span class="comment">                        rdc.numVertices = c;</span>
<a name="l01472"></a>01472 <span class="comment">                        rdc.primitiveCount = d;</span>
<a name="l01473"></a>01473 <span class="comment">                        rdc.indexData = e;</span>
<a name="l01474"></a>01474 <span class="comment">                        rdc.indexDataFormat = f;</span>
<a name="l01475"></a>01475 <span class="comment">                        rdc.vertexStreamZeroData = g;</span>
<a name="l01476"></a>01476 <span class="comment">                        rdc.vertexStreamZeroSride = h;</span>
<a name="l01477"></a>01477 <span class="comment"></span>
<a name="l01478"></a>01478 <span class="comment">                        DepthDrawRecorder.RecordDrawCall(rdc);</span>
<a name="l01479"></a>01479 <span class="comment">                }*/</span>
<a name="l01480"></a>01480                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;DrawIndexedPrimitiveUP (a, b, c, d, e, f, g, h);
<a name="l01481"></a>01481         }
<a name="l01482"></a>01482 
<a name="l01483"></a>01483         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01484"></a>01484 
<a name="l01485"></a><a class="code" href="class_fake_device.html#ad8f56dcad9fda5a58bb025ae35deda34">01485</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ad8f56dcad9fda5a58bb025ae35deda34">ProcessVertices</a> (UINT a, UINT b, UINT c, <a class="code" href="_wrapper_8hpp.html#a2948e9a89ece242fca10c57037f70e4b">IDirect3DVertexBuffer8</a> *d, DWORD e) {
<a name="l01486"></a>01486                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;ProcessVertices (a, b, c, (IDirect3DVertexBuffer9 *)d, NULL, e);
<a name="l01487"></a>01487         }
<a name="l01488"></a>01488 
<a name="l01489"></a>01489         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01490"></a>01490 
<a name="l01491"></a><a class="code" href="class_fake_device.html#ab1b720de49bc0d198ce704d96b33ca9a">01491</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ab1b720de49bc0d198ce704d96b33ca9a">CreateVertexShader</a> (<span class="keyword">const</span> DWORD *a, <span class="keyword">const</span> DWORD *b, DWORD *c, DWORD d) {
<a name="l01516"></a>01516                 <span class="comment">//HRESULT hr = RealDevice-&gt;CreateVertexShader ((DWORD *)ShaderData-&gt;GetBufferPointer (), &amp;NewVShaders [(*c - 3) / 2]);</span>
<a name="l01517"></a>01517                 <span class="comment">//HRESULT hr = RealDevice-&gt;CreateVertexShader(</span>
<a name="l01518"></a>01518                 <span class="comment">//if (ShaderData) ShaderData-&gt;Release ();</span>
<a name="l01519"></a>01519                 <span class="keywordflow">return</span> D3D_OK;
<a name="l01520"></a>01520         }
<a name="l01521"></a>01521 
<a name="l01522"></a>01522         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01523"></a>01523 
<a name="l01524"></a><a class="code" href="class_fake_device.html#a2ae7743fe3902006d15d85acca5ce140">01524</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a2ae7743fe3902006d15d85acca5ce140">SetVertexShader</a> (DWORD a) {
<a name="l01525"></a>01525                 
<a name="l01526"></a>01526                 <span class="keywordflow">switch</span> (a) {
<a name="l01527"></a>01527                 <span class="keywordflow">case</span> 0:
<a name="l01528"></a>01528                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetVertexShader (NULL);
<a name="l01529"></a>01529                 <span class="keywordflow">case</span> 3:
<a name="l01530"></a>01530                 <span class="keywordflow">case</span> 5:
<a name="l01531"></a>01531                 <span class="keywordflow">case</span> 9:
<a name="l01532"></a>01532                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetVertexDeclaration (<a class="code" href="class_fake_device.html#a8d4deb416252736f35530a9b4807cb2d">decl</a> [0]);
<a name="l01533"></a>01533                         <span class="keywordflow">break</span>;
<a name="l01534"></a>01534                 <span class="keywordflow">case</span> 7:
<a name="l01535"></a>01535                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetVertexDeclaration (<a class="code" href="class_fake_device.html#a8d4deb416252736f35530a9b4807cb2d">decl</a> [1]);
<a name="l01536"></a>01536                         <span class="keywordflow">break</span>;
<a name="l01537"></a>01537                 <span class="keywordflow">default</span>:
<a name="l01538"></a>01538                         <span class="comment">//Save FVF setting</span>
<a name="l01539"></a>01539                         <a class="code" href="class_fake_device.html#a543a74276836e37dc7b18302bf4eba69">mRenderState</a>.<a class="code" href="struct_fake_device_1_1_render_state.html#a65fc74530726f7c787e585f1265cb549">FVF</a> = a;
<a name="l01540"></a>01540 
<a name="l01541"></a>01541                         <a class="code" href="class_fake_device.html#a66ae179edd3a2b28cb0c871233785945">CurrentVShader</a> = 0;
<a name="l01542"></a>01542                         <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetVertexShader (NULL);
<a name="l01543"></a>01543                         <a class="code" href="class_fake_device.html#aa6d5d66a0ad79cf4852cd266b8bf270e">CurrentFVF</a> = a;
<a name="l01544"></a>01544                         <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetFVF (a);
<a name="l01545"></a>01545                 }
<a name="l01546"></a>01546                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetVertexShader (<a class="code" href="class_fake_device.html#aa168d4ab0d42e2cd7cdb28d63b25ecea">NewVShaders</a> [(a - 3) / 2]);
<a name="l01547"></a>01547                 
<a name="l01548"></a>01548                 <span class="comment">//return D3D_OK;</span>
<a name="l01549"></a>01549         }
<a name="l01550"></a>01550 
<a name="l01551"></a>01551         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01552"></a>01552 
<a name="l01553"></a><a class="code" href="class_fake_device.html#a716a75dc8b66fdf7503d35eaa7b0f6fb">01553</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a716a75dc8b66fdf7503d35eaa7b0f6fb">GetVertexShader</a> (DWORD *a) {
<a name="l01554"></a>01554                 <span class="comment">/*</span>
<a name="l01555"></a>01555 <span class="comment">                if (CurrentVShader != 0) {</span>
<a name="l01556"></a>01556 <span class="comment">                        *a = CurrentVShader;</span>
<a name="l01557"></a>01557 <span class="comment">                        return D3D_OK;</span>
<a name="l01558"></a>01558 <span class="comment">                } else {</span>
<a name="l01559"></a>01559 <span class="comment">                        return RealDevice-&gt;GetFVF (a);</span>
<a name="l01560"></a>01560 <span class="comment">                }</span>
<a name="l01561"></a>01561 <span class="comment">                */</span>
<a name="l01562"></a>01562                 <span class="keywordflow">return</span> D3D_OK;
<a name="l01563"></a>01563         }
<a name="l01564"></a>01564 
<a name="l01565"></a>01565         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01566"></a>01566 
<a name="l01567"></a><a class="code" href="class_fake_device.html#a704a4ffa23ebcb1c9d1da09a17fd135c">01567</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a704a4ffa23ebcb1c9d1da09a17fd135c">DeleteVertexShader</a> (DWORD a) {
<a name="l01568"></a>01568                 <span class="keywordflow">if</span> (<a class="code" href="class_fake_device.html#aa168d4ab0d42e2cd7cdb28d63b25ecea">NewVShaders</a> [(a - 3) / 2] != NULL) {
<a name="l01569"></a>01569                         <span class="keywordflow">while</span> (<a class="code" href="class_fake_device.html#aa168d4ab0d42e2cd7cdb28d63b25ecea">NewVShaders</a> [(a - 3) / 2]-&gt;<a class="code" href="class_fake_device.html#ac330e6892b60ec55569183a87eaa967a">Release</a> ());
<a name="l01570"></a>01570                         <a class="code" href="class_fake_device.html#aa168d4ab0d42e2cd7cdb28d63b25ecea">NewVShaders</a> [(a - 3) / 2] = NULL;
<a name="l01571"></a>01571                 }
<a name="l01572"></a>01572                 <span class="keywordflow">return</span> D3D_OK;
<a name="l01573"></a>01573         }
<a name="l01574"></a>01574 
<a name="l01575"></a>01575         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01576"></a>01576 
<a name="l01577"></a><a class="code" href="class_fake_device.html#a39595e7e8fc0e40677f6ed4a01cb001f">01577</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a39595e7e8fc0e40677f6ed4a01cb001f">SetVertexShaderConstant</a> (DWORD a, <span class="keyword">const</span> <span class="keywordtype">void</span> *b, DWORD c) {
<a name="l01578"></a>01578                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetVertexShaderConstantF (a, (<span class="keywordtype">float</span> *)b, c);
<a name="l01579"></a>01579         }
<a name="l01580"></a>01580 
<a name="l01581"></a>01581         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01582"></a>01582 
<a name="l01583"></a><a class="code" href="class_fake_device.html#a3fc237a4098ac4c677e4ca0256947c75">01583</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a3fc237a4098ac4c677e4ca0256947c75">GetVertexShaderConstant</a> (DWORD a, <span class="keywordtype">void</span> *b, DWORD c) {
<a name="l01584"></a>01584                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetVertexShaderConstantF (a, (<span class="keywordtype">float</span> *)b, c);
<a name="l01585"></a>01585         }
<a name="l01586"></a>01586 
<a name="l01587"></a>01587         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01588"></a>01588 
<a name="l01589"></a><a class="code" href="class_fake_device.html#a49109cdc6ffe625c5044ac0c72b30d16">01589</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a49109cdc6ffe625c5044ac0c72b30d16">GetVertexShaderDeclaration</a> (DWORD a, <span class="keywordtype">void</span> *b, DWORD *c) {
<a name="l01590"></a>01590                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01591"></a>01591         }
<a name="l01592"></a>01592 
<a name="l01593"></a>01593         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01594"></a>01594 
<a name="l01595"></a><a class="code" href="class_fake_device.html#ae00ebcdb597a25cbd051d645b7d252ac">01595</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ae00ebcdb597a25cbd051d645b7d252ac">GetVertexShaderFunction</a> (DWORD a, <span class="keywordtype">void</span> *b, DWORD *c) {
<a name="l01596"></a>01596                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01597"></a>01597         }
<a name="l01598"></a>01598 
<a name="l01599"></a>01599         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01600"></a>01600 
<a name="l01601"></a><a class="code" href="class_fake_device.html#af09ba626aa5d4f1a586b0c57fb52ca4d">01601</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#af09ba626aa5d4f1a586b0c57fb52ca4d">SetStreamSource</a> (UINT a, <a class="code" href="_wrapper_8hpp.html#a2948e9a89ece242fca10c57037f70e4b">IDirect3DVertexBuffer8</a> *b, UINT c) {
<a name="l01602"></a>01602                 <a class="code" href="class_fake_device.html#ac75a85a982b778f35535aea66afa7cea">CurrentVBuffer</a> = (IDirect3DVertexBuffer9 *)b;
<a name="l01603"></a>01603                 <a class="code" href="class_fake_device.html#ad78e3741b05b9b4338f87fbcdc05bef5">CurrentStreamSpan</a> = c;
<a name="l01604"></a>01604                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetStreamSource (a, (IDirect3DVertexBuffer9 *)b, 0, c);
<a name="l01605"></a>01605         }
<a name="l01606"></a>01606 
<a name="l01607"></a>01607         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01608"></a>01608 
<a name="l01609"></a><a class="code" href="class_fake_device.html#ad57fe9b6d248807815b4504c5877513a">01609</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ad57fe9b6d248807815b4504c5877513a">GetStreamSource</a> (UINT a, <a class="code" href="_wrapper_8hpp.html#a2948e9a89ece242fca10c57037f70e4b">IDirect3DVertexBuffer8</a> **b, UINT *c) {
<a name="l01610"></a>01610                 UINT unused;
<a name="l01611"></a>01611                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetStreamSource (a, (IDirect3DVertexBuffer9 **)b, &amp;unused, c);
<a name="l01612"></a>01612         }
<a name="l01613"></a>01613 
<a name="l01614"></a>01614         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01615"></a>01615 
<a name="l01616"></a><a class="code" href="class_fake_device.html#af6d127ca8c692f9fecb9ac386f0179d4">01616</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#af6d127ca8c692f9fecb9ac386f0179d4">SetIndices</a> (<a class="code" href="_wrapper_8hpp.html#a2bba8b27146a002a78736dd4e1c75e3d">IDirect3DIndexBuffer8</a> *a, UINT b) {
<a name="l01617"></a>01617                 <a class="code" href="class_fake_device.html#acf30afa80ffa62865b04427c91d6b206">BaseVertexIndex</a> = b; <span class="comment">//BaseVertexIndex has been moved to ProcessVerticies ()</span>
<a name="l01618"></a>01618                 <a class="code" href="class_fake_device.html#aa68cca664ade44caa70996afd7fddb4f">CurrentIndices</a> = (IDirect3DIndexBuffer9 *)a;
<a name="l01619"></a>01619                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetIndices ((IDirect3DIndexBuffer9 *)a);
<a name="l01620"></a>01620         }
<a name="l01621"></a>01621 
<a name="l01622"></a>01622         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01623"></a>01623 
<a name="l01624"></a><a class="code" href="class_fake_device.html#af3364d92f43ce625d560c33c6da7e901">01624</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#af3364d92f43ce625d560c33c6da7e901">GetIndices</a> (<a class="code" href="_wrapper_8hpp.html#a2bba8b27146a002a78736dd4e1c75e3d">IDirect3DIndexBuffer8</a> **a, UINT *b) {
<a name="l01625"></a>01625                 *b = <a class="code" href="class_fake_device.html#acf30afa80ffa62865b04427c91d6b206">BaseVertexIndex</a>;
<a name="l01626"></a>01626                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetIndices ((IDirect3DIndexBuffer9 **)a);
<a name="l01627"></a>01627         }
<a name="l01628"></a>01628 
<a name="l01629"></a>01629         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01630"></a>01630 
<a name="l01631"></a><a class="code" href="class_fake_device.html#ab1dab7c9cc61678fc9429df34c40a13d">01631</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ab1dab7c9cc61678fc9429df34c40a13d">CreatePixelShader</a> (<span class="keyword">const</span> DWORD *a, DWORD *b) {
<a name="l01632"></a>01632                 <span class="comment">/*PixelShading = true;</span>
<a name="l01633"></a>01633 <span class="comment">                *b = ++pShaderCount;</span>
<a name="l01634"></a>01634 <span class="comment">                ID3DXBuffer *ShaderData = NULL;</span>
<a name="l01635"></a>01635 <span class="comment">                char shaderfile [MAX_PATH];</span>
<a name="l01636"></a>01636 <span class="comment">                sprintf_s (shaderfile, sizeof (shaderfile), &quot;Data Files\\shaders\\water\\ps%i.txt&quot;, *b);</span>
<a name="l01637"></a>01637 <span class="comment">                if (*b &lt;= 9 &amp;&amp; *b &gt; 0) D3DXAssembleShaderFromFileA (shaderfile, NULL, NULL, 0, &amp;ShaderData, NULL);</span>
<a name="l01638"></a>01638 <span class="comment">                else ERRORMSG (&quot;Morrowind tried to create an unexpected pixel shader&quot;);</span>
<a name="l01639"></a>01639 <span class="comment">                HRESULT hr = RealDevice-&gt;CreatePixelShader ((DWORD *)ShaderData-&gt;GetBufferPointer (), &amp;NewPShaders [*b - 1]);</span>
<a name="l01640"></a>01640 <span class="comment">                if (hr != D3D_OK) {</span>
<a name="l01641"></a>01641 <span class="comment">                        DebugBreak ();</span>
<a name="l01642"></a>01642 <span class="comment">                }</span>
<a name="l01643"></a>01643 <span class="comment">                if (ShaderData != NULL) ShaderData-&gt;Release ();</span>
<a name="l01644"></a>01644 <span class="comment">                return hr;*/</span>
<a name="l01645"></a>01645                 <span class="keywordflow">return</span> D3D_OK;
<a name="l01646"></a>01646         }
<a name="l01647"></a>01647 
<a name="l01648"></a>01648         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01649"></a>01649 
<a name="l01650"></a><a class="code" href="class_fake_device.html#a944d27eb8eb936922ecfd10fbe26eb5e">01650</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a944d27eb8eb936922ecfd10fbe26eb5e">SetPixelShader</a> (DWORD a) {
<a name="l01651"></a>01651                 <span class="comment">//CurrentPShader = a;</span>
<a name="l01652"></a>01652                 <span class="comment">//if (a == 0) return RealDevice-&gt;SetPixelShader (NULL);</span>
<a name="l01653"></a>01653                 <span class="comment">//else </span>
<a name="l01654"></a>01654                 <span class="comment">//return RealDevice-&gt;SetPixelShader (a);</span>
<a name="l01655"></a>01655                 <span class="keywordflow">return</span> D3D_OK;
<a name="l01656"></a>01656         }
<a name="l01657"></a>01657 
<a name="l01658"></a>01658         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01659"></a>01659 
<a name="l01660"></a><a class="code" href="class_fake_device.html#a8c3fa95ab55bf67eb5c15b135588c0ca">01660</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a8c3fa95ab55bf67eb5c15b135588c0ca">GetPixelShader</a> (DWORD *a) {
<a name="l01661"></a>01661                 *a = NULL;
<a name="l01662"></a>01662                 <span class="keywordflow">return</span> D3D_OK;
<a name="l01663"></a>01663         }
<a name="l01664"></a>01664 
<a name="l01665"></a>01665         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01666"></a>01666 
<a name="l01667"></a><a class="code" href="class_fake_device.html#ae159d2bf05cd0208e32e5982afce511b">01667</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ae159d2bf05cd0208e32e5982afce511b">DeletePixelShader</a> (DWORD a) {
<a name="l01668"></a>01668                 <span class="comment">/*if (NewPShaders [a - 1] != NULL) {</span>
<a name="l01669"></a>01669 <span class="comment">                        while (NewPShaders [a - 1]-&gt;Release ());</span>
<a name="l01670"></a>01670 <span class="comment">                        NewPShaders [a - 1] = NULL;</span>
<a name="l01671"></a>01671 <span class="comment">                }*/</span>
<a name="l01672"></a>01672                 <span class="keywordflow">return</span> D3D_OK;
<a name="l01673"></a>01673         }
<a name="l01674"></a>01674 
<a name="l01675"></a>01675         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01676"></a>01676 
<a name="l01677"></a><a class="code" href="class_fake_device.html#ace2a95244e9477fe5d955df54e83655d">01677</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#ace2a95244e9477fe5d955df54e83655d">SetPixelShaderConstant</a> (DWORD a, <span class="keyword">const</span> <span class="keywordtype">void</span> *b, DWORD c) {
<a name="l01678"></a>01678                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;SetPixelShaderConstantF (a, (<span class="keywordtype">float</span> *)b, c);
<a name="l01679"></a>01679         }
<a name="l01680"></a>01680 
<a name="l01681"></a>01681         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01682"></a>01682 
<a name="l01683"></a><a class="code" href="class_fake_device.html#a9e9cb8189d1e35f556fc1449d41c97de">01683</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a9e9cb8189d1e35f556fc1449d41c97de">GetPixelShaderConstant</a> (DWORD a, <span class="keywordtype">void</span> *b, DWORD c) {
<a name="l01684"></a>01684                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;GetPixelShaderConstantF (a, (<span class="keywordtype">float</span> *)b, c);
<a name="l01685"></a>01685         }
<a name="l01686"></a>01686 
<a name="l01687"></a>01687         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01688"></a>01688 
<a name="l01689"></a><a class="code" href="class_fake_device.html#a70c6777fe7c213cba22c6aba4859da43">01689</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a70c6777fe7c213cba22c6aba4859da43">GetPixelShaderFunction</a> (DWORD a, <span class="keywordtype">void</span> * b, DWORD * c) {
<a name="l01690"></a>01690                 <span class="keywordflow">return</span> <a class="code" href="_wrapper_8hpp.html#ab6ea3a5af75b860b6e3d74f48d230d7c">UnusedFunction</a> ();
<a name="l01691"></a>01691         }
<a name="l01692"></a>01692 
<a name="l01693"></a>01693         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01694"></a>01694 
<a name="l01695"></a><a class="code" href="class_fake_device.html#a17e545d1ea3928165ad2a1aa4b1ce6fd">01695</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a17e545d1ea3928165ad2a1aa4b1ce6fd">DrawRectPatch</a> (UINT a, <span class="keyword">const</span> <span class="keywordtype">float</span> *b, <span class="keyword">const</span> D3DRECTPATCH_INFO *c) {
<a name="l01696"></a>01696                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;DrawRectPatch (a, b, c);
<a name="l01697"></a>01697         }
<a name="l01698"></a>01698 
<a name="l01699"></a>01699         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01700"></a>01700 
<a name="l01701"></a><a class="code" href="class_fake_device.html#a2bb59bc818fb5b0c326c7ac773091da2">01701</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a2bb59bc818fb5b0c326c7ac773091da2">DrawTriPatch</a> (UINT a, <span class="keyword">const</span> <span class="keywordtype">float</span> *b, <span class="keyword">const</span> D3DTRIPATCH_INFO *c) {
<a name="l01702"></a>01702                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;DrawTriPatch (a, b, c);
<a name="l01703"></a>01703         }
<a name="l01704"></a>01704 
<a name="l01705"></a>01705         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01706"></a>01706 
<a name="l01707"></a><a class="code" href="class_fake_device.html#a0c4af4d08a87c7b56a71bd973c2f7248">01707</a>         HRESULT _stdcall <a class="code" href="class_fake_device.html#a0c4af4d08a87c7b56a71bd973c2f7248">DeletePatch</a> (UINT a) {
<a name="l01708"></a>01708                 <span class="keywordflow">return</span> <a class="code" href="class_fake_device.html#a4f833dfa4f7d679935506b4af8056024">RealDevice</a>-&gt;DeletePatch (a);
<a name="l01709"></a>01709         }
<a name="l01710"></a>01710 
<a name="l01711"></a>01711         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01712"></a>01712 
<a name="l01713"></a>01713 };
<a name="l01714"></a>01714 
<a name="l01715"></a>01715 
<a name="l01722"></a><a class="code" href="class_fake_object.html">01722</a> <span class="keyword">class </span><a class="code" href="class_fake_object.html" title="Fake DX8 object class for use by the game.">FakeObject</a> 
<a name="l01723"></a>01723         : <span class="keyword">public</span> IDirect3D8 
<a name="l01724"></a>01724 {
<a name="l01725"></a>01725 <span class="keyword">private</span>:
<a name="l01730"></a><a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd">01730</a>         IDirect3D9 * <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>;
<a name="l01731"></a>01731 
<a name="l01732"></a>01732 <span class="keyword">public</span>:
<a name="l01737"></a><a class="code" href="class_fake_object.html#a480d0613725b2cfa332cb7cfa9715b21">01737</a>         DWORD <a class="code" href="class_fake_object.html#a480d0613725b2cfa332cb7cfa9715b21" title="Reference count for this object.">Refs</a>;
<a name="l01738"></a>01738 
<a name="l01744"></a><a class="code" href="class_fake_object.html#ab98dc79313c91cca4d84d844f52ccc7e">01744</a>         <a class="code" href="class_fake_object.html#ab98dc79313c91cca4d84d844f52ccc7e" title="Default ctor, simply wraps a real object and initializes the reference count.">FakeObject</a>(IDirect3D9 * realObject)
<a name="l01745"></a>01745         {
<a name="l01746"></a>01746                 <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a> = realObject;
<a name="l01747"></a>01747                 <a class="code" href="class_fake_object.html#a480d0613725b2cfa332cb7cfa9715b21" title="Reference count for this object.">Refs</a> = 1;
<a name="l01748"></a>01748 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01749"></a>01749 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: Created FakeObject at %d.\n&quot;</span>).With(<span class="keyword">this</span>).Done();
<a name="l01750"></a>01750 <span class="preprocessor">#endif</span>
<a name="l01751"></a>01751 <span class="preprocessor"></span>        }
<a name="l01752"></a>01752 
<a name="l01757"></a><a class="code" href="group___fake_object___i_unknown.html#gab9d8bbc518aff139b247574665269cb7">01757</a>         HRESULT _stdcall <a class="code" href="group___fake_object___i_unknown.html#gab9d8bbc518aff139b247574665269cb7">QueryInterface</a>(REFIID <a class="code" href="_wrapper_8hpp.html#aa9ea26faccd0670ffca16d885f3f2b94">guid</a>, LPVOID * dest)
<a name="l01758"></a>01758         {
<a name="l01759"></a>01759 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01760"></a>01760 <span class="preprocessor"></span>                HRESULT hr = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;QueryInterface(guid, dest);
<a name="l01761"></a>01761                 <span class="comment">// Log the GUID and return pointer for the query.</span>
<a name="l01762"></a>01762                 <span class="comment">// Unnecessary: yes. Potentially interesting: yes.</span>
<a name="l01763"></a>01763                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record
<a name="l01764"></a>01764                         (<span class="stringliteral">&quot;Voodoo GEM: FakeObject::QueryInterface({%d,%d,%d,{%d,%d,%d,%d,%d,%d,%d,%d}}, %d) == %d\n&quot;</span>)
<a name="l01765"></a>01765                         .With(guid.Data1).With(guid.Data2).With(guid.Data3)
<a name="l01766"></a>01766                         .With(guid.Data4[0]).With(guid.Data4[1]).With(guid.Data4[2]).With(guid.Data4[3])
<a name="l01767"></a>01767                         .With(guid.Data4[4]).With(guid.Data4[5]).With(guid.Data4[6]).With(guid.Data4[7])
<a name="l01768"></a>01768                         .With(dest).With(hr).Done();
<a name="l01769"></a>01769 
<a name="l01770"></a>01770                 <span class="keywordflow">return</span> hr;
<a name="l01771"></a>01771 <span class="preprocessor">#else</span>
<a name="l01772"></a>01772 <span class="preprocessor"></span>                <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;QueryInterface(guid, dest);
<a name="l01773"></a>01773 <span class="preprocessor">#endif</span>
<a name="l01774"></a>01774 <span class="preprocessor"></span>        }
<a name="l01775"></a>01775 
<a name="l01776"></a><a class="code" href="group___fake_object___i_unknown.html#ga2a12be286bb64b22f895dc8623ce9b9b">01776</a>         ULONG _stdcall <a class="code" href="group___fake_object___i_unknown.html#ga2a12be286bb64b22f895dc8623ce9b9b">AddRef</a>(<span class="keywordtype">void</span>)
<a name="l01777"></a>01777         {
<a name="l01778"></a>01778 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01779"></a>01779 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::AddRef() == %d\n&quot;</span>).With(++<a class="code" href="class_fake_object.html#a480d0613725b2cfa332cb7cfa9715b21" title="Reference count for this object.">Refs</a>).Done();
<a name="l01780"></a>01780 <span class="preprocessor">#else</span>
<a name="l01781"></a>01781 <span class="preprocessor"></span>                ++<a class="code" href="class_fake_object.html#a480d0613725b2cfa332cb7cfa9715b21" title="Reference count for this object.">Refs</a>;
<a name="l01782"></a>01782 <span class="preprocessor">#endif</span>
<a name="l01783"></a>01783 <span class="preprocessor"></span>
<a name="l01784"></a>01784                 <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a480d0613725b2cfa332cb7cfa9715b21" title="Reference count for this object.">Refs</a>;
<a name="l01785"></a>01785         }
<a name="l01786"></a>01786 
<a name="l01787"></a><a class="code" href="group___fake_object___i_unknown.html#ga68bd901b8c3304af18f3363a67a60988">01787</a>         ULONG _stdcall <a class="code" href="group___fake_object___i_unknown.html#ga68bd901b8c3304af18f3363a67a60988">Release</a>(<span class="keywordtype">void</span>) 
<a name="l01788"></a>01788         {
<a name="l01789"></a>01789 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01790"></a>01790 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::Release() == %d\n&quot;</span>).With(--<a class="code" href="class_fake_object.html#a480d0613725b2cfa332cb7cfa9715b21" title="Reference count for this object.">Refs</a>).Done();
<a name="l01791"></a>01791 <span class="preprocessor">#else</span>
<a name="l01792"></a>01792 <span class="preprocessor"></span>                --<a class="code" href="class_fake_object.html#a480d0613725b2cfa332cb7cfa9715b21" title="Reference count for this object.">Refs</a>;
<a name="l01793"></a>01793 <span class="preprocessor">#endif</span>
<a name="l01794"></a>01794 <span class="preprocessor"></span>
<a name="l01795"></a>01795                 <span class="keywordflow">if</span> (<a class="code" href="class_fake_object.html#a480d0613725b2cfa332cb7cfa9715b21" title="Reference count for this object.">Refs</a> == 0) 
<a name="l01796"></a>01796                 {
<a name="l01797"></a>01797                         VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Log(<span class="stringliteral">&quot;Voodoo GEM: Refs == 0, releasing underlying object.\n&quot;</span>);
<a name="l01798"></a>01798 
<a name="l01799"></a>01799                         <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;Release();
<a name="l01800"></a>01800                         <span class="keyword">delete</span> <span class="keyword">this</span>;
<a name="l01801"></a>01801                         <span class="keywordflow">return</span> 0;
<a name="l01802"></a>01802                 }
<a name="l01803"></a>01803 
<a name="l01804"></a>01804                 <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a480d0613725b2cfa332cb7cfa9715b21" title="Reference count for this object.">Refs</a>;
<a name="l01805"></a>01805         }
<a name="l01811"></a>01811         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01812"></a>01812         <span class="comment">/*** IDirect3D8 methods ***/</span>
<a name="l01813"></a>01813         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01814"></a>01814 
<a name="l01815"></a><a class="code" href="class_fake_object.html#abc6266409d2957ee43fb973de5480ee1">01815</a>         HRESULT _stdcall <a class="code" href="class_fake_object.html#abc6266409d2957ee43fb973de5480ee1">RegisterSoftwareDevice</a> (<span class="keywordtype">void</span> * device)
<a name="l01816"></a>01816         {
<a name="l01817"></a>01817 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01818"></a>01818 <span class="preprocessor"></span>                HRESULT hr = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;RegisterSoftwareDevice(device);
<a name="l01819"></a>01819 
<a name="l01820"></a>01820                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::RegisterSoftwareDevice(%d) == %d\n&quot;</span>)
<a name="l01821"></a>01821                         .With(device).With(hr).Done();
<a name="l01822"></a>01822 
<a name="l01823"></a>01823                 <span class="keywordflow">return</span> hr;
<a name="l01824"></a>01824 <span class="preprocessor">#else</span>
<a name="l01825"></a>01825 <span class="preprocessor"></span>                <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;RegisterSoftwareDevice(device);
<a name="l01826"></a>01826 <span class="preprocessor">#endif</span>
<a name="l01827"></a>01827 <span class="preprocessor"></span>        }
<a name="l01828"></a>01828 
<a name="l01829"></a>01829         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01830"></a>01830 
<a name="l01831"></a><a class="code" href="class_fake_object.html#a15712f9cb3ec45fb9e878da24d151e12">01831</a>         UINT _stdcall <a class="code" href="class_fake_object.html#a15712f9cb3ec45fb9e878da24d151e12">GetAdapterCount</a>(<span class="keywordtype">void</span>)
<a name="l01832"></a>01832         {
<a name="l01833"></a>01833 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01834"></a>01834 <span class="preprocessor"></span>                UINT count = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;GetAdapterCount();
<a name="l01835"></a>01835 
<a name="l01836"></a>01836                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::GetAdapterCount() == %d\n&quot;</span>)
<a name="l01837"></a>01837                         .With(count).Done();
<a name="l01838"></a>01838 
<a name="l01839"></a>01839                 <span class="keywordflow">return</span> count;
<a name="l01840"></a>01840 <span class="preprocessor">#else</span>
<a name="l01841"></a>01841 <span class="preprocessor"></span>                <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;GetAdapterCount();
<a name="l01842"></a>01842 <span class="preprocessor">#endif</span>
<a name="l01843"></a>01843 <span class="preprocessor"></span>        }
<a name="l01844"></a>01844 
<a name="l01845"></a>01845         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01846"></a>01846 
<a name="l01847"></a><a class="code" href="class_fake_object.html#a125d65292009aca00693530f470b93df">01847</a>         HRESULT _stdcall <a class="code" href="class_fake_object.html#a125d65292009aca00693530f470b93df">GetAdapterIdentifier</a>(UINT adapter, DWORD flags, <a class="code" href="struct___d3_d_a_d_a_p_t_e_r___i_d_e_n_t_i_f_i_e_r8.html">D3DADAPTER_IDENTIFIER8</a> * dest)
<a name="l01848"></a>01848         {
<a name="l01849"></a>01849                 <span class="comment">// Get the results, but force the WHQL flags to 0 (no validation)</span>
<a name="l01850"></a>01850                 D3DADAPTER_IDENTIFIER9 buffer;
<a name="l01851"></a>01851                 HRESULT hr = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;GetAdapterIdentifier(adapter, 0, &amp;buffer);
<a name="l01852"></a>01852 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01853"></a>01853 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::GetAdapterIdentifier(%d, %d, %d) == %d\n&quot;</span>)
<a name="l01854"></a>01854                         .With(adapter).With(flags).With(dest).With(hr).Done();
<a name="l01855"></a>01855 <span class="preprocessor">#endif</span>
<a name="l01856"></a>01856 <span class="preprocessor"></span>
<a name="l01857"></a>01857                 <span class="keywordflow">if</span> (hr == D3D_OK) {
<a name="l01858"></a>01858                         <span class="comment">//Strings, so use copymemory instead of assignment</span>
<a name="l01859"></a>01859                         ::CopyMemory (dest, &amp;buffer, 1024);
<a name="l01860"></a>01860                         dest-&gt;<a class="code" href="struct___d3_d_a_d_a_p_t_e_r___i_d_e_n_t_i_f_i_e_r8.html#acf1f03c9f225c21f3af3b78b79b8e0fd">DeviceId</a>                  = buffer.DeviceId;
<a name="l01861"></a>01861                         dest-&gt;<a class="code" href="struct___d3_d_a_d_a_p_t_e_r___i_d_e_n_t_i_f_i_e_r8.html#abc037bbe7efc7e8774d0094381fa678c">DeviceIdentifier</a>  = buffer.DeviceIdentifier;
<a name="l01862"></a>01862                         dest-&gt;<a class="code" href="struct___d3_d_a_d_a_p_t_e_r___i_d_e_n_t_i_f_i_e_r8.html#a2448e864919bc081adc5526b95d41cab">DriverVersion</a>             = buffer.DriverVersion;
<a name="l01863"></a>01863                         dest-&gt;<a class="code" href="struct___d3_d_a_d_a_p_t_e_r___i_d_e_n_t_i_f_i_e_r8.html#a7632de235a29d0abd2bb328580fe5747">Revision</a>                  = buffer.Revision;
<a name="l01864"></a>01864                         dest-&gt;<a class="code" href="struct___d3_d_a_d_a_p_t_e_r___i_d_e_n_t_i_f_i_e_r8.html#a7d2d5fd004e5f68226a5eb62d0d5a4bc">SubSysId</a>                  = buffer.SubSysId;
<a name="l01865"></a>01865                         dest-&gt;<a class="code" href="struct___d3_d_a_d_a_p_t_e_r___i_d_e_n_t_i_f_i_e_r8.html#a9e07151e8c7cc9cf60e96904181ff26a">VendorId</a>                  = buffer.VendorId;
<a name="l01866"></a>01866                         dest-&gt;<a class="code" href="struct___d3_d_a_d_a_p_t_e_r___i_d_e_n_t_i_f_i_e_r8.html#a2d2f5efa52a3ec2a027cd03e1af7e2fd">WHQLLevel</a>                 = buffer.WHQLLevel;
<a name="l01867"></a>01867                 }
<a name="l01868"></a>01868 
<a name="l01869"></a>01869                 <span class="keywordflow">return</span> hr;
<a name="l01870"></a>01870         }
<a name="l01871"></a>01871 
<a name="l01872"></a>01872         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01873"></a>01873 
<a name="l01874"></a><a class="code" href="class_fake_object.html#a3ad51c721dfd62aad4f80c1a089610c4">01874</a>         UINT _stdcall <a class="code" href="class_fake_object.html#a3ad51c721dfd62aad4f80c1a089610c4">GetAdapterModeCount</a>(UINT adapter)
<a name="l01875"></a>01875         {
<a name="l01876"></a>01876                 <span class="comment">// By default, use the X8R8G8B8 format as the test format (it&#39;s standard screen format).</span>
<a name="l01877"></a>01877 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01878"></a>01878 <span class="preprocessor"></span>                UINT result = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;GetAdapterModeCount(adapter, D3DFMT_X8R8G8B8);
<a name="l01879"></a>01879                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::GetAdapterModeCount(%d, D3DFMT_X8R8G8B8) == %d\n&quot;</span>)
<a name="l01880"></a>01880                         .With(adapter).With(result).Done();
<a name="l01881"></a>01881                 <span class="keywordflow">return</span> result;
<a name="l01882"></a>01882 <span class="preprocessor">#else</span>
<a name="l01883"></a>01883 <span class="preprocessor"></span>                <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;GetAdapterModeCount(adapter, D3DFMT_X8R8G8B8);
<a name="l01884"></a>01884 <span class="preprocessor">#endif</span>
<a name="l01885"></a>01885 <span class="preprocessor"></span>        }
<a name="l01886"></a>01886 
<a name="l01887"></a>01887         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01888"></a>01888 
<a name="l01889"></a><a class="code" href="class_fake_object.html#ae88d7a06c181eb576cb4af4b5960cdc6">01889</a>         HRESULT _stdcall <a class="code" href="class_fake_object.html#ae88d7a06c181eb576cb4af4b5960cdc6">EnumAdapterModes</a>(UINT adapter, UINT mode, D3DDISPLAYMODE * displayMode)
<a name="l01890"></a>01890         {
<a name="l01891"></a>01891 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01892"></a>01892 <span class="preprocessor"></span>                UINT result = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;EnumAdapterModes(adapter, D3DFMT_X8R8G8B8, mode, displayMode);
<a name="l01893"></a>01893                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::EnumAdapterModes(%d, D3DFMT_X8R8G8B8, %d, %d) == %d\n&quot;</span>)
<a name="l01894"></a>01894                         .With(adapter).With(mode).With(displayMode).With(result).Done();
<a name="l01895"></a>01895                 <span class="keywordflow">return</span> result;
<a name="l01896"></a>01896 <span class="preprocessor">#else</span>
<a name="l01897"></a>01897 <span class="preprocessor"></span>                <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;EnumAdapterModes(adapter, D3DFMT_X8R8G8B8, mode, displayMode);
<a name="l01898"></a>01898 <span class="preprocessor">#endif</span>
<a name="l01899"></a>01899 <span class="preprocessor"></span>        }
<a name="l01900"></a>01900 
<a name="l01901"></a>01901         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01902"></a>01902 
<a name="l01903"></a><a class="code" href="class_fake_object.html#ae5d5618f55284a3f35adfbfc5e850693">01903</a>         HRESULT _stdcall <a class="code" href="class_fake_object.html#ae5d5618f55284a3f35adfbfc5e850693">GetAdapterDisplayMode</a>(UINT adapter, D3DDISPLAYMODE * displayMode)
<a name="l01904"></a>01904         {
<a name="l01905"></a>01905                 <span class="comment">// Hide the fact that windows is using a 16bit colour depth (?)</span>
<a name="l01906"></a>01906                 HRESULT hr = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;GetAdapterDisplayMode(adapter, displayMode);
<a name="l01907"></a>01907                 displayMode-&gt;Format = D3DFMT_X8R8G8B8;
<a name="l01908"></a>01908 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01909"></a>01909 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::GetAdapterDisplayMode(%d, %d) == %d\n&quot;</span>)
<a name="l01910"></a>01910                         .With(adapter).With(displayMode).With(hr).Done();
<a name="l01911"></a>01911 <span class="preprocessor">#endif</span>
<a name="l01912"></a>01912 <span class="preprocessor"></span>                <span class="keywordflow">return</span> hr;
<a name="l01913"></a>01913         }
<a name="l01914"></a>01914 
<a name="l01915"></a>01915         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01916"></a>01916 
<a name="l01917"></a><a class="code" href="class_fake_object.html#a1b466110ca0e6b0df1cf17e3473ee9ec">01917</a>         HRESULT _stdcall <a class="code" href="class_fake_object.html#a1b466110ca0e6b0df1cf17e3473ee9ec">CheckDeviceType</a>(UINT adapter, D3DDEVTYPE type, D3DFORMAT format,
<a name="l01918"></a>01918                 D3DFORMAT bbformat, BOOL windowed) 
<a name="l01919"></a>01919         {
<a name="l01920"></a>01920 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01921"></a>01921 <span class="preprocessor"></span>                HRESULT hr = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;CheckDeviceType(adapter, type, format, bbformat, windowed);
<a name="l01922"></a>01922                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::CheckDeviceType(%d, %d, %d, %d, %d) == %d\n&quot;</span>)
<a name="l01923"></a>01923                         .With(adapter).With(type).With(format).With(bbformat).With(windowed).With(hr).Done();
<a name="l01924"></a>01924                 <span class="keywordflow">return</span> hr;
<a name="l01925"></a>01925 <span class="preprocessor">#else</span>
<a name="l01926"></a>01926 <span class="preprocessor"></span>                <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;CheckDeviceType(adapter, type, format, bbformat, windowed);
<a name="l01927"></a>01927 <span class="preprocessor">#endif</span>
<a name="l01928"></a>01928 <span class="preprocessor"></span>        }
<a name="l01929"></a>01929 
<a name="l01930"></a>01930         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01931"></a>01931 
<a name="l01932"></a><a class="code" href="class_fake_object.html#a9928671a5d0ca4d81a2a4a7513631ac4">01932</a>         HRESULT _stdcall <a class="code" href="class_fake_object.html#a9928671a5d0ca4d81a2a4a7513631ac4">CheckDeviceFormat</a>(UINT adapter, D3DDEVTYPE type, D3DFORMAT format,
<a name="l01933"></a>01933                 DWORD usage, D3DRESOURCETYPE rtype, D3DFORMAT checkformat)
<a name="l01934"></a>01934         {
<a name="l01935"></a>01935 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01936"></a>01936 <span class="preprocessor"></span>                HRESULT hr = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;CheckDeviceFormat(adapter, type, format, usage, rtype, checkformat);
<a name="l01937"></a>01937                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::CheckDeviceFormat(%d, %d, %d, %d, %d, %d) == %d\n&quot;</span>)
<a name="l01938"></a>01938                         .With(adapter).With(type).With(format).With(usage).With(rtype).With(checkformat).With(hr).Done();
<a name="l01939"></a>01939                 <span class="keywordflow">return</span> hr;
<a name="l01940"></a>01940 <span class="preprocessor">#else</span>
<a name="l01941"></a>01941 <span class="preprocessor"></span>                <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;CheckDeviceFormat(adapter, type, format, usage, rtype, checkformat);
<a name="l01942"></a>01942 <span class="preprocessor">#endif</span>
<a name="l01943"></a>01943 <span class="preprocessor"></span>        }
<a name="l01944"></a>01944 
<a name="l01945"></a>01945         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01946"></a>01946 
<a name="l01947"></a><a class="code" href="class_fake_object.html#af7c4118ba2e027b556f3f5790362ebef">01947</a>         HRESULT _stdcall <a class="code" href="class_fake_object.html#af7c4118ba2e027b556f3f5790362ebef">CheckDeviceMultiSampleType</a>(UINT adapter, D3DDEVTYPE type, D3DFORMAT format,
<a name="l01948"></a>01948                 BOOL windowed, D3DMULTISAMPLE_TYPE multisampletype)
<a name="l01949"></a>01949         {
<a name="l01950"></a>01950                 <span class="comment">// Retrieve the multisample type info, ignoring quality levels.</span>
<a name="l01951"></a>01951 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01952"></a>01952 <span class="preprocessor"></span>                HRESULT hr = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;CheckDeviceMultiSampleType(adapter, type, format, windowed, multisampletype, NULL);
<a name="l01953"></a>01953                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::CheckDeviceMultiSampleType(%d, %d, %d, %d, %d) == %d\n&quot;</span>)
<a name="l01954"></a>01954                         .With(adapter).With(type).With(format).With(windowed).With(multisampletype).With(hr).Done();
<a name="l01955"></a>01955                 <span class="keywordflow">return</span> hr;
<a name="l01956"></a>01956 <span class="preprocessor">#else</span>
<a name="l01957"></a>01957 <span class="preprocessor"></span>                <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;CheckDeviceMultiSampleType(adapter, type, format, windowed, multisampletype, NULL);
<a name="l01958"></a>01958 <span class="preprocessor">#endif</span>
<a name="l01959"></a>01959 <span class="preprocessor"></span>        }
<a name="l01960"></a>01960 
<a name="l01961"></a>01961         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01962"></a>01962 
<a name="l01963"></a><a class="code" href="class_fake_object.html#a8238cfe68286a2e348bccd66794ec9e9">01963</a>         HRESULT _stdcall <a class="code" href="class_fake_object.html#a8238cfe68286a2e348bccd66794ec9e9">CheckDepthStencilMatch</a>(UINT adapter, D3DDEVTYPE type, D3DFORMAT format,
<a name="l01964"></a>01964                 D3DFORMAT rtformat, D3DFORMAT dsformat)
<a name="l01965"></a>01965         {
<a name="l01966"></a>01966 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01967"></a>01967 <span class="preprocessor"></span>                HRESULT hr = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;CheckDepthStencilMatch(adapter, type, format, rtformat, dsformat);
<a name="l01968"></a>01968                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::CheckDepthStencilMatch(%d, %d, %d, %d, %d) == %d\n&quot;</span>)
<a name="l01969"></a>01969                         .With(adapter).With(type).With(format).With(rtformat).With(dsformat).With(hr).Done();
<a name="l01970"></a>01970                 <span class="keywordflow">return</span> hr;
<a name="l01971"></a>01971 <span class="preprocessor">#else</span>
<a name="l01972"></a>01972 <span class="preprocessor"></span>                <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;CheckDepthStencilMatch(adapter, type, format, rtformat, dsformat);
<a name="l01973"></a>01973 <span class="preprocessor">#endif</span>
<a name="l01974"></a>01974 <span class="preprocessor"></span>        }
<a name="l01975"></a>01975 
<a name="l01976"></a>01976         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01977"></a>01977 
<a name="l01978"></a><a class="code" href="class_fake_object.html#a628e8eefbf794c2e94367483bb4cb2b7">01978</a>         HRESULT _stdcall <a class="code" href="class_fake_object.html#a628e8eefbf794c2e94367483bb4cb2b7">GetDeviceCaps</a>(UINT adapter, D3DDEVTYPE type, <a class="code" href="struct___d3_d_c_a_p_s8.html">D3DCAPS8</a> * caps) 
<a name="l01979"></a>01979         {
<a name="l01980"></a>01980                 <span class="comment">// Return stored (and modified) capabilities structure.</span>
<a name="l01981"></a>01981                 *caps = d3d8Caps;
<a name="l01982"></a>01982 
<a name="l01983"></a>01983 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01984"></a>01984 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::GetDeviceCaps(%d, %d, %d) == D3D_OK\n&quot;</span>)
<a name="l01985"></a>01985                         .With(adapter).With(type).With(caps).Done();
<a name="l01986"></a>01986 <span class="preprocessor">#endif</span>
<a name="l01987"></a>01987 <span class="preprocessor"></span>                <span class="keywordflow">return</span> D3D_OK;
<a name="l01988"></a>01988         }
<a name="l01989"></a>01989 
<a name="l01990"></a>01990         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01991"></a>01991 
<a name="l01992"></a><a class="code" href="class_fake_object.html#a3549c42b3310208da58c954b4f1301f5">01992</a>         HMONITOR _stdcall <a class="code" href="class_fake_object.html#a3549c42b3310208da58c954b4f1301f5">GetAdapterMonitor</a>(UINT adapter)
<a name="l01993"></a>01993         {
<a name="l01994"></a>01994 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l01995"></a>01995 <span class="preprocessor"></span>                HMONITOR hm = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;GetAdapterMonitor(adapter);
<a name="l01996"></a>01996                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::GetAdapterMonitor(%d) == %d\n&quot;</span>)
<a name="l01997"></a>01997                         .With(adapter).With(hm).Done();
<a name="l01998"></a>01998                 <span class="keywordflow">return</span> hm;
<a name="l01999"></a>01999 <span class="preprocessor">#else</span>
<a name="l02000"></a>02000 <span class="preprocessor"></span>                <span class="keywordflow">return</span> <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;GetAdapterMonitor(adapter);
<a name="l02001"></a>02001 <span class="preprocessor">#endif</span>
<a name="l02002"></a>02002 <span class="preprocessor"></span>        }
<a name="l02003"></a>02003 
<a name="l02004"></a>02004         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l02005"></a>02005 
<a name="l02006"></a><a class="code" href="class_fake_object.html#af416c9babb63c24ea2b6a467efc4fd3f">02006</a>         HRESULT _stdcall <a class="code" href="class_fake_object.html#af416c9babb63c24ea2b6a467efc4fd3f">CreateDevice</a>(UINT adapter, D3DDEVTYPE type, HWND window,
<a name="l02007"></a>02007                 DWORD flags, <a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html">D3DPRESENT_PARAMETERS8</a> * presentparams, IDirect3DDevice8 ** device) 
<a name="l02008"></a>02008         {
<a name="l02009"></a>02009                 <span class="comment">// Need to record resolution and such here, as well as create temporary surfaces.</span>
<a name="l02010"></a>02010 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l02011"></a>02011 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Log(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::CreateDevice called.\n&quot;</span>);
<a name="l02012"></a>02012 <span class="preprocessor">#endif</span>
<a name="l02013"></a>02013 <span class="preprocessor"></span>
<a name="l02014"></a>02014                 <a class="code" href="_wrapper_8hpp.html#a0604f04fe31c715e66d2b6ed3eb10d99">D3DPRESENT_PARAMETERS9</a> pp;
<a name="l02015"></a>02015                 pp.Flags = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a8666139cb242168804f6f891f965d4be">Flags</a>;
<a name="l02016"></a>02016                 pp.Windowed = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a2bcc288fa1fd90760bed8c3dac31d408">Windowed</a>;
<a name="l02017"></a>02017                 pp.BackBufferCount = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a0d0660e554c1c791bb170406794ad9be">BackBufferCount</a>;
<a name="l02018"></a>02018                 pp.BackBufferFormat = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#aa59a1dc06f1bb00dc59b37d92d32d6b6">BackBufferFormat</a>;
<a name="l02019"></a>02019                 pp.BackBufferHeight = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a5ecebc829744442c2486fec7ccf258b4">BackBufferHeight</a>;
<a name="l02020"></a>02020                 pp.BackBufferWidth = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#ac724056834a50cf1abf9667fcf669ac4">BackBufferWidth</a>;
<a name="l02021"></a>02021                 pp.hDeviceWindow = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a248091d75b3eba9b67dd82eb9fb9957b">hDeviceWindow</a>;
<a name="l02022"></a>02022                 pp.EnableAutoDepthStencil = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a086a5094fedaf2d36e90d5f773d5e7af">EnableAutoDepthStencil</a>;
<a name="l02023"></a>02023                 pp.SwapEffect = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a9374b55437b94b1bbaef854fc9299d45">SwapEffect</a>;
<a name="l02024"></a>02024                 pp.MultiSampleQuality = 0;
<a name="l02025"></a>02025                 pp.MultiSampleType = presentparams-&gt;<a class="code" href="struct___d3_d_p_r_e_s_e_n_t___p_a_r_a_m_e_t_e_r_s8__.html#a1f57ad7da0324b3948b25b69f2431e5a">MultiSampleType</a>;
<a name="l02026"></a>02026 
<a name="l02027"></a>02027                 <span class="keywordflow">if</span> (pp.Flags &amp; D3DPRESENTFLAG_LOCKABLE_BACKBUFFER) pp.Flags ^= D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
<a name="l02028"></a>02028 
<a name="l02029"></a>02029                 pp.AutoDepthStencilFormat = D3DFMT_D24S8;
<a name="l02030"></a>02030                 pp.FullScreen_RefreshRateInHz = 0;
<a name="l02031"></a>02031                 pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
<a name="l02032"></a>02032 
<a name="l02033"></a>02033 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l02034"></a>02034 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: Backbuffer parameters: %d by %d (%d buffers), format %d.\n&quot;</span>)
<a name="l02035"></a>02035                         .With(pp.BackBufferWidth).With(pp.BackBufferHeight).With(pp.BackBufferCount).With(pp.BackBufferFormat).Done();
<a name="l02036"></a>02036 <span class="preprocessor">#endif</span>
<a name="l02037"></a>02037 <span class="preprocessor"></span>
<a name="l02038"></a>02038                 IDirect3DDevice9 * RealDevice;
<a name="l02039"></a>02039 
<a name="l02040"></a>02040                 HRESULT hr = <a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>-&gt;CreateDevice(adapter, type, window, flags, &amp;pp, &amp;RealDevice);
<a name="l02041"></a>02041 
<a name="l02042"></a>02042 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l02043"></a>02043 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: FakeObject::CreateDevice(%d, %d, %d, %d, %d, %d) == %d\n&quot;</span>)
<a name="l02044"></a>02044                         .With(adapter).With(type).With(window).With(flags).With(&amp;pp).With(RealDevice).With(hr).Done();
<a name="l02045"></a>02045 <span class="preprocessor">#endif</span>
<a name="l02046"></a>02046 <span class="preprocessor"></span>
<a name="l02047"></a>02047                 <span class="keywordflow">if</span> (hr != D3D_OK || RealDevice == NULL) <span class="keywordflow">return</span> hr;
<a name="l02048"></a>02048 
<a name="l02049"></a>02049 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l02050"></a>02050 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Log(<span class="stringliteral">&quot;Voodoo GEM: Real device created.\n&quot;</span>);
<a name="l02051"></a>02051 <span class="preprocessor">#endif</span>
<a name="l02052"></a>02052 <span class="preprocessor"></span>
<a name="l02053"></a>02053                         <span class="comment">/*D3DFORMAT fmt;</span>
<a name="l02054"></a>02054 <span class="comment">                        switch (ZBufFormat) {</span>
<a name="l02055"></a>02055 <span class="comment">                        case 1:</span>
<a name="l02056"></a>02056 <span class="comment">                                fmt = (D3DFORMAT)MAKEFOURCC (&#39;I&#39;, &#39;N&#39;, &#39;T&#39;, &#39;Z&#39;);</span>
<a name="l02057"></a>02057 <span class="comment">                                break;</span>
<a name="l02058"></a>02058 <span class="comment">                        case 2:</span>
<a name="l02059"></a>02059 <span class="comment">                                fmt = (D3DFORMAT)MAKEFOURCC (&#39;R&#39;, &#39;A&#39;, &#39;W&#39;, &#39;Z&#39;);</span>
<a name="l02060"></a>02060 <span class="comment">                                break;</span>
<a name="l02061"></a>02061 <span class="comment">                        case 3:</span>
<a name="l02062"></a>02062 <span class="comment">                                fmt = (D3DFORMAT)MAKEFOURCC (&#39;D&#39;, &#39;F&#39;, &#39;1&#39;, &#39;6&#39;);</span>
<a name="l02063"></a>02063 <span class="comment">                                break;</span>
<a name="l02064"></a>02064 <span class="comment">                        case 4:</span>
<a name="l02065"></a>02065 <span class="comment">                                fmt = (D3DFORMAT)MAKEFOURCC (&#39;D&#39;, &#39;F&#39;, &#39;2&#39;, &#39;4&#39;);</span>
<a name="l02066"></a>02066 <span class="comment">                                break;</span>
<a name="l02067"></a>02067 <span class="comment">                        }*/</span>
<a name="l02068"></a>02068                 <span class="comment">//hr = RealDevice-&gt;CreateTexture (e-&gt;BackBufferWidth, e-&gt;BackBufferHeight, 1, </span>
<a name="l02069"></a>02069                 <span class="comment">//                              D3DUSAGE_DEPTHSTENCIL, fmt, D3DPOOL_DEFAULT, &amp;DepthTexture, 0);</span>
<a name="l02070"></a>02070 
<a name="l02071"></a>02071 
<a name="l02072"></a>02072                 <span class="comment">//RealDevice-&gt;SetRenderState (D3DRS_ZENABLE, D3DZB_USEW);</span>
<a name="l02073"></a>02073                 <span class="comment">//RealDevice-&gt;SetRenderState (D3DRS_CLIPPING, (D3DTEXTURESTAGESTATETYPE)0);</span>
<a name="l02074"></a>02074                 
<a name="l02075"></a>02075                 <span class="comment">//Create a font object for scribbling over the screen</span>
<a name="l02076"></a>02076                 <span class="comment">//if (D3DXCreateFontA (RealDevice, 12, 0, 400, 1, false, ANSI_CHARSET, OUT_DEFAULT_PRECIS,</span>
<a name="l02077"></a>02077                 <span class="comment">//      DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, &quot;arial&quot;, &amp;Font)</span>
<a name="l02078"></a>02078 
<a name="l02079"></a>02079 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l02080"></a>02080 <span class="preprocessor"></span>                VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Log(<span class="stringliteral">&quot;Voodoo GEM: Creating fake device...\n&quot;</span>);
<a name="l02081"></a>02081 <span class="preprocessor">#endif</span>
<a name="l02082"></a>02082 <span class="preprocessor"></span>                <a class="code" href="class_fake_device.html">FakeDevice</a> * fdevice = <span class="keyword">new</span> <a class="code" href="class_fake_device.html">FakeDevice</a>(this-&gt;<a class="code" href="class_fake_object.html#a087c5bee3cd6aaf17284b60f3af3b3dd" title="Private reference to the real DX object.">mRealObject</a>, RealDevice);
<a name="l02083"></a>02083                 *device = fdevice;
<a name="l02084"></a>02084 
<a name="l02085"></a>02085                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Log(<span class="stringliteral">&quot;Voodoo GEM: Starting VoodooDX9 module...\n&quot;</span>);
<a name="l02086"></a>02086                 VoodooDX9 = <span class="keyword">new</span> <a class="code" href="class_voodoo_shader_1_1_direct_x9_1_1_adapter.html">VoodooShader::DirectX9::Adapter</a>(RealDevice);
<a name="l02087"></a>02087                 <span class="comment">//VoodooCore-&gt;SetAdapter((VoodooShader::Adapter*)VoodooDX9);</span>
<a name="l02088"></a>02088 
<a name="l02089"></a>02089                 <span class="keywordflow">return</span> D3D_OK;
<a name="l02090"></a>02090         }
<a name="l02091"></a>02091 
<a name="l02092"></a>02092         <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l02093"></a>02093 };
<a name="l02094"></a>02094 
<a name="l02095"></a>02095 
<a name="l02096"></a>02096 <span class="comment">//=============================================================================</span>
<a name="l02097"></a>02097 
<a name="l02098"></a><a class="code" href="_wrapper_8cpp.html#abc84b55bea9f61ead371bf17437198b0">02098</a> <a class="code" href="_wrapper_8cpp.html#abc84b55bea9f61ead371bf17437198b0">__declspec</a>(dllexport) void * __stdcall Direct3DCreate8 (UINT version)
<a name="l02099"></a>02099 {
<a name="l02100"></a>02100         <span class="comment">// Voodoo DX8.9 Init function</span>
<a name="l02101"></a>02101         VoodooCore = <span class="keyword">new</span> <a class="code" href="class_voodoo_shader_1_1_core.html" title="Core engine class for the Voodoo Shader Framework.">VoodooShader::Core</a>(<span class="stringliteral">&quot;Voodoo_GEM.log&quot;</span>);
<a name="l02102"></a>02102 
<a name="l02103"></a>02103         VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Format-&gt;Record(<span class="stringliteral">&quot;Voodoo GEM: Direct3DCreate8 called, SDK version: %d.\n&quot;</span>).With(version).Done();
<a name="l02104"></a>02104 
<a name="l02105"></a>02105         <span class="comment">// First, load D3D8.dll and check capabilities of the DX8 device/drivers</span>
<a name="l02106"></a>02106         <span class="keywordtype">char</span> Path[MAX_PATH];
<a name="l02107"></a>02107         GetSystemDirectoryA(Path, MAX_PATH);
<a name="l02108"></a>02108         strcat_s (Path, MAX_PATH, <span class="stringliteral">&quot;\\d3d8.dll&quot;</span>);
<a name="l02109"></a>02109 
<a name="l02110"></a>02110         HMODULE D3D8Library = LoadLibraryA(Path);
<a name="l02111"></a>02111         <span class="keywordflow">if</span> (D3D8Library == NULL) 
<a name="l02112"></a>02112         {
<a name="l02113"></a>02113                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Log(<span class="stringliteral">&quot;Voodoo GEM: Unable to load D3D8.dll.\n&quot;</span>);
<a name="l02114"></a>02114                 <span class="keywordflow">return</span> NULL;
<a name="l02115"></a>02115         }
<a name="l02116"></a>02116 
<a name="l02117"></a>02117         <span class="keyword">typedef</span> IDirect3D8 * (__stdcall*D3DFunc8)(UINT);
<a name="l02118"></a>02118         D3DFunc8 D3D8Create = (D3DFunc8)GetProcAddress (D3D8Library, <span class="stringliteral">&quot;Direct3DCreate8&quot;</span>);
<a name="l02119"></a>02119         <span class="keywordflow">if</span> (D3D8Create == NULL)
<a name="l02120"></a>02120         {
<a name="l02121"></a>02121                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Log(<span class="stringliteral">&quot;Voodoo GEM: Unable to find function Direct3DCreate8 in D3D8.dll.\n&quot;</span>);
<a name="l02122"></a>02122                 <span class="keywordflow">return</span> NULL;
<a name="l02123"></a>02123         }
<a name="l02124"></a>02124 
<a name="l02125"></a>02125         IDirect3D8 * TempObject = (D3D8Create)(version);
<a name="l02126"></a>02126         HRESULT hr = TempObject-&gt;GetDeviceCaps (0, D3DDEVTYPE_HAL, &amp;d3d8Caps);
<a name="l02127"></a>02127         <span class="keywordflow">if</span> (hr != D3D_OK)
<a name="l02128"></a>02128         { 
<a name="l02129"></a>02129                 VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Log(<span class="stringliteral">&quot;Voodoo GEM: Unable to retrieve DX8 capabilities.\n&quot;</span>); 
<a name="l02130"></a>02130         }
<a name="l02131"></a>02131         TempObject-&gt;Release();
<a name="l02132"></a>02132         FreeLibrary(D3D8Library);
<a name="l02133"></a>02133 
<a name="l02134"></a>02134         VoodooCore-&gt;<a class="code" href="class_voodoo_shader_1_1_core.html#a3dae50629a1c77bd5ac311829ba48c6b">GetLog</a>()-&gt;Log(<span class="stringliteral">&quot;Voodoo GEM: DX8 capabilities retrieved successfully.\n&quot;</span>); 
<a name="l02135"></a>02135 
<a name="l02136"></a>02136         <span class="comment">// Forcibly disable shaders in the caps</span>
<a name="l02137"></a>02137         d3d8Caps.<a class="code" href="struct___d3_d_c_a_p_s8.html#a08c08d933fe24ae6d2e1fcf31a8e4510">PixelShaderVersion</a> = 0;
<a name="l02138"></a>02138         d3d8Caps.<a class="code" href="struct___d3_d_c_a_p_s8.html#a8a120af8c3c49b72ac1ec1986435305b">VertexShaderVersion</a> = 0;
<a name="l02139"></a>02139 
<a name="l02140"></a>02140         <span class="comment">// Call DX9 to create a real device with the latest version</span>
<a name="l02141"></a>02141         IDirect3D9 * <span class="keywordtype">object</span> = Direct3DCreate9(D3D_SDK_VERSION);
<a name="l02142"></a>02142         <span class="comment">// Turn it into a FakeObject and return it.</span>
<a name="l02143"></a>02143         <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="class_fake_object.html" title="Fake DX8 object class for use by the game.">FakeObject</a>(<span class="keywordtype">object</span>);
<a name="l02144"></a>02144 }
<a name="l02145"></a>02145 
<a name="l02146"></a>02146 <span class="comment">// Visual Studio-specific linker directive, forces the function to be exported with and</span>
<a name="l02147"></a>02147 <span class="comment">// without decoration. The actual symbol is undecorated, but I&#39;d rather allow exception</span>
<a name="l02148"></a>02148 <span class="comment">// handling than use extern &quot;C&quot;.</span>
<a name="l02149"></a>02149 <span class="preprocessor">#pragma comment(linker, &quot;/export:Direct3DCreate8=?Direct3DCreate8@@YGPAXI@Z&quot;)</span>
<a name="l02150"></a>02150 <span class="preprocessor"></span>
<a name="l02151"></a>02151 <span class="comment">//=============================================================================</span>
<a name="l02152"></a>02152 
</pre></div></div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Oct 14 19:58:31 2010 for Voodoo Shader Framework by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
